Alexey Malakhov
2011/5/30 Igor R
> Basically, what I'm trying to do is: > > using namespace boost::posix_time; > using namespace boost::this_thread; > > time_duration td = milliseconds(2000); > sleep(&td);
Just curious: what's the purpose of the ampersand here? http://www.boost.org/doc/libs/1_46_1/doc/html/thread/thread_management.html #thread.thread_management.this_thread.sleep
Igor, thanks for the note. My ampersand came from VS refusing to compile otherwise. But you're right, semantically it should not be there.
And it's true, in win32 version this_thread::sleep() declaration is inline void sleep(TimeDuration const& rel_time) { interruptible_wait(detail::pin_to_zero(rel_time->total_milliseconds ())); }
No, it isn't. I don't know where the -> came from, but it's not in the boost source.
It's probably not supposed to be like that, but this is the only way it's working for me. If anyone could come up with a more elegant solution, I'd appreciate it greatly.
Install the latest boost and use sleep(td) on all platforms. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976