
Hi! I'm trying to use condition_variable::timed_wait without success. Using the following code, the timed_wait returns immediatly also if Receive() is never called. Where I wrong? void Receive() { boost::lock_guardboost::mutex lock(_mut); //... code ...// _data_ready = true; // Notify and unlock the mutex _cond.notify_one(); } bool Send() { boost::unique_lockboost::mutex lock(_mut); boost::xtime xt; xtime_get(&xt, boost::TIME_UTC); xt.sec += 5; _data_ready = false; //... send data ...// //wait for an answer.. bool ready = _cond.timed_wait(lock, xt, boost::lambda::var(_data_ready)); return ready; } I've also tried to use: ptime t = second_clock::universal_time(); ptime timeout = t + milliseconds(cmd_timeout); bool ready = _cond.timed_wait(lock, timeout, boost::lambda::var(_data_ready)); but with the same effect. Thanks, Daniele.