tags:

views:

151

answers:

2

I have to update an application to use Boost 1.34 instead of 1.37, and it's causing me a ton of trouble.

One of the biggest problems at the moment is that I don't know Boost threads very well. With 1.34, I get...

error C2039: 'this_thread' : is not a member of 'boost'

...for the code

boost::this_thread::sleep(boost::posix_time::milliseconds(500));

boost::posix_time is not in 1.34 either.

Does anyone know the equivilant Boost 1.34 function calls?

+1  A: 

boost::thread::sleep(boost::posix_time::ptime(...));

aloneguid
Changing `this_thread` to `thread` helped, thanks. However, `posix_time` is not defined. Any ideas for that?
Justin
+2  A: 

boost::thread::sleep takes a struct xtime in 1.34.1. Try this:

struct xtime timeout;
timeout.sec = 0;
timeout.nsec = 500 * 1000000;
boost::thread::sleep(timeout);
bdonlan