Re: [Boost-bugs] [Boost C++ Libraries] #6787: boost::thread::sleep() hangs if system time is rolled back

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6787: boost::thread::sleep() hangs if system time is rolled back
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-02 06:33:20


#6787: boost::thread::sleep() hangs if system time is rolled back
-----------------------------------------------+----------------------
  Reporter: Artem Gayardo-Matrosov <boost@…> | Owner: viboes
      Type: Bugs | Status: reopened
 Milestone: Boost 1.57.0 | Component: thread
   Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------------------+----------------------

Comment (by viboes):

 Could you add


 {{{
 #ifndef BOOST_THREAD_SLEEP_FOR_IS_STEADY
 #error
 #endif
 }}}


 and replace the call to sleep_for by

 {{{
   timespec ts =
 boost::detail::to_timespec(boost::chrono::milliseconds(1000));
   nanosleep( &ts, 0);
 }}}
 ?

 The program must compile and run as you expect. It it is not the case you
 need to make it work as you expect before.

 Have you re built the Boost library after changing your compiler flags? If
 not do it, otherwise the code will not use nanosleep :(

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6787#comment:31>
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:17 UTC