Re: [Boost-bugs] [Boost C++ Libraries] #5418: Error in asio example: tick_count_timer

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5418: Error in asio example: tick_count_timer
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-13 23:32:16


#5418: Error in asio example: tick_count_timer
-------------------------------+--------------------------------------------
  Reporter: Peter Grimstrup | Owner: chris_kohlhoff
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: asio
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by Ross MacGregor <gordonrossmacgregor@…>):

 I've discovered a more serious problem. Methods
 tick_count_traits::subtract will return a large overflow value if t2 > t1.
 This happens periodically in the timer_queue and causes the timer to stop
 working for a long period of time.

 I've attached my solution to the problem. Basically, I changed
 duration_type to be a signed value that is reflected in the call to the
 method to_posix_duration. It may be possible to reduce my subtract method
 to something less complicated. I've also included a small test for
 tick_count_traits in the example.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5418#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC