I want to wait on a condition for up to 1 second. I've try passing in time_duration:
boost::posix_time::time_duration td = boost::posix_time::milliseconds(50);
readerThread_cond_.timed_wait(lock, boost::bind(&XXXX::writeCondIsMet, this), td);
but I get the error:
/usr/include/boost/thread/pthread/condition_variable.hpp:156: error: no match for ‘operator+’ in ‘boost::get_system_time() + wait_duration’
I've also tried passing a xtime:
boost::xtime t;
boost::xtime_get(&t, boost::TIME_UTC);
readerThread_cond_.timed_wait(lock, boost::bind(&XXXX::writeCondIsMet, this), td);
but I get the error:
I'm linking with libboost_thread and libboost_date_time and the code compiles and run ok when I use just use wait, but the error message it seems to related to resolving the templates in the boost header files. It seems to be saying I am not passing in the right thing, but I just don't understand it.