Re: [Boost-bugs] [Boost C++ Libraries] #5891: timed_join works incorrecly on Windows

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5891: timed_join works incorrecly on Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-04 15:57:06


#5891: timed_join works incorrecly on Windows
----------------------------------+-----------------------------------------
  Reporter: sr@… | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords: timed_join
----------------------------------+-----------------------------------------

Comment (by viboes):

 I have tried with


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

 using namespace std;
 using namespace boost;

 int main()
 {
   struct {
     void operator()()
     {
         boost::this_thread::sleep(posix_time::seconds(2));
     }
   } run;
   boost::thread myThread(run);
   boost::this_thread::yield();
   if(myThread.timed_join(posix_time::seconds(5)))
   {
     cout << "thats ok";
     return 0;
   }
   else
   {
     cout << "too late";
     return 1;
   }
 }
 }}}

 and everything is Ok for me. I have no way to reproduce your error.
 Any way this is a case that could occur in an extreme case (processor
 overloaded) as the run thread could not start immediately. Maybe you could
 add some timestamp traces
 to see when main start to join and when the thread run start and finish.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5891#comment:2>
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:07 UTC