[Boost-bugs] [Boost C++ Libraries] #2447: get_due_time returns incorrect due_time if boost::date_time resolution is nanoseconds

Subject: [Boost-bugs] [Boost C++ Libraries] #2447: get_due_time returns incorrect due_time if boost::date_time resolution is nanoseconds
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-29 17:49:52


#2447: get_due_time returns incorrect due_time if boost::date_time resolution is
nanoseconds
---------------------------------+------------------------------------------
 Reporter: rwightman_at_[hidden] | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: thread
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 There is a bug in the calculation of due_time (line 343 in thread.cpp)
 where the calculation to add the fractional seconds will always add 0 if
 the boost::date_time library has been configured to use nanosecond
 resolution.

 The integer division of
 hundred_nanoseconds_in_one_second/target_time.abs_time.time_of_day().ticks_per_second()
 will be 0 when date_time uses nanosecond resolution since the denominator
 will be 10**9 and always greater than the numerator which is 10**7. At the
 default date_time resolution of 10**6 this works fine.

 Facilities like boost::condition::timed_wait which rely on this function
 will not block for the desired amount of time if the wait time is < 1 sec.

 This issue has been present since 1.35.0.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2447>
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:49:59 UTC