Boost logo

Boost Users :

Subject: [Boost-users] Problem with boost::thread::sleep
From: Rob Yull (ryull_at_[hidden])
Date: 2010-01-08 12:58:00


Using Boost 1.41, MSVC 2005, Win 7 x64 (compiling 32-bit).

I was trying to set a small delay in a loop, so the loop doesn't consume all
of the processor, using boost::thread::sleep(). I tried using the example
from the threading documentation
(http://www.boost.org/doc/libs/1_41_0/doc/html/thread/time.html#thread.time.
get_system_time):

boost::thread::sleep(boost::posix_time::milliseconds(25));

I keep getting a compiler error from the line above.

Error 2 error C2664: 'boost::thread::sleep' : cannot convert
parameter 1 from
'boost::date_time::subsecond_duration<base_duration,frac_of_second>' to
'const boost::system_time &'

Is there something else I need to be doing to make this work?

-Rob Yull


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net