Boost logo

Boost Users :

Subject: [Boost-users] question about interprocess_condition::timed_wait
From: Isaac Lascasas (isaaclascasas_at_[hidden])
Date: 2009-02-24 22:38:17


I'm trying to use interprocess_condition::timed_wait without success. I
never get the timeout in my code. I think I don't understand at all how
posix_time works. My code is the following:

 ptime t = boost::posix_time::microsec_clock::local_time();
ptime timeout = t + milliseconds(1000);

scoped_lock<interprocess_mutex> lock(InterprocessMutex, timeout);
if (get_shared_data(lock).m_message)
  if (!InterprocessCondition.timed_wait(lock, timeout))
    {
    // handle timeout
    }

Is that ok?

Thanks.



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