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:

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

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

std::cout
     << "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?

Jamie


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk