[Boost-bugs] [Boost C++ Libraries] #9880: boost::condition_variable.timed_wait() exception if system time < 1970

Subject: [Boost-bugs] [Boost C++ Libraries] #9880: boost::condition_variable.timed_wait() exception if system time < 1970
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-14 09:08:22


#9880: boost::condition_variable.timed_wait() exception if system time < 1970
-----------------------+------------------------------
 Reporter: anonymous | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.55.0
 Severity: Problem | Keywords:
-----------------------+------------------------------
 Os: any windows.
 Set system time < 01.01.1970, for example 01.01.1950.

 Any call to boost::condition_variable.timed_wait() with relative(!) time
 throw exception because boost try get system time in posix format.

 How to fix:
 boost\thread\win32\thread_data.hpp, line 179 (boost 1.55.0). In
 constructor
             timeout(uintmax_t milliseconds_):
                 start(win32::GetTickCount64()),
                 milliseconds(milliseconds_),
                 relative(true),
                 abs_time(boost::get_system_time())
             {}
 we set "relative(true)" and there for not need to set variable "abs_time".
 Must be:
             timeout(uintmax_t milliseconds_):
                 start(win32::GetTickCount64()),
                 milliseconds(milliseconds_),
                 relative(true)
             {}

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