Re: [Boost-bugs] [Boost C++ Libraries] #8768: win32 condition_variable::wait_until infinite wait in rare cases

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8768: win32 condition_variable::wait_until infinite wait in rare cases
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-09-03 11:56:19


#8768: win32 condition_variable::wait_until infinite wait in rare cases
-------------------------------------+-------------------------------------
  Reporter: Dmitry Lysachenko | Owner: viboes
  <xdemonx07@…> | Status: closed
      Type: Bugs | Component: thread
 Milestone: To Be Determined | Severity: Problem
   Version: Boost 1.54.0 | Keywords: win32, thread,
Resolution: wontfix | condition_variable, wait_until
-------------------------------------+-------------------------------------

Comment (by s.heil@…):

 We ran into this problem as well and after a lot of debugging, we found
 this ticket.
 In our case we got bit by that problem in production code, so we really
 hope it will get fixed. We also have a simple test, that in about 7 of 10
 runs reproduces the problem:

 {{{
 #include <iostream>
 #include <boost/thread.hpp>
 #include <boost/chrono.hpp>

 using namespace std;

 int main( int argc, const char* argv[] )
 {
         boost::mutex mutex;
         boost::condition_variable variable;
         boost::unique_lock<boost::mutex> lock( mutex );
         for ( int i = 5; i >= - 10; i -- ) {
                 boost::chrono::time_point<boost::chrono::steady_clock>
 time =
                         boost::chrono::steady_clock::now() +
 boost::chrono::milliseconds( i );
                 std::cerr << "test " << i << ": " << " ... ";
                 variable.wait_until( lock, time );
                 std::cerr << "ok" << std::endl;
         }
 }
 }}}

 The only solution we see right now is to not ever use wait_until, as it
 might block forever. So we are replacing all calls to wait_until in our
 code with calls to wait_for.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8768#comment:4>
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:14 UTC