Boost logo

Boost :

Subject: [boost] [thread] boost::this_thread::sleep broken?
From: Jamie Allsop (ja11sop_at_[hidden])
Date: 2010-12-24 21:06:19

 From the docs I'd expect to be able to write this:

     << "Time Before Sleep: "
     << boost::posix_time::microsec_clock::local_time()
     << std::endl;

boost::this_thread::sleep( boost::posix_time::seconds(10) );

     << "Time After Sleep : "
     << boost::posix_time::microsec_clock::local_time()
     << std::endl;

and have the 'this' thread sleep for approximately 10 seconds. Instead
sleep returns instantaneously:

Time Before Sleep: 2010-Dec-25 01:38:50.949160000
Time After Sleep : 2010-Dec-25 01:38:50.949436000

I've tried this with boost 1.45 and boost 1.43 using gcc 4.4 on debian
x86_64. Am I missing something obvious?


Boost list run by bdawes at, gregod at, cpdaniel at, john at