Boost logo

Boost :

Subject: [boost] [interprocess] difference in timed_wait behavior under linux and windows
From: Sergei Politov (spolitov_at_[hidden])
Date: 2008-09-17 10:20:15


Hello,

  I have the following issue, when I'm calling
interprocess_condition.timed_wait with time equals to
boost::posix_time::pos_infin it has different behavior under linux and under
windows.

  Under windows it is similar to interprocess_condition.wait, but under
linux it fails with assertion here:
file boost\interprocess\sync\posix\interprocess_condition.hpp:

inline bool interprocess_condition::do_timed_wait
   (const boost::posix_time::ptime &abs_time, interprocess_mutex &mut)
{
   timespec ts = detail::ptime_to_timespec(abs_time);
   pthread_mutex_t* pmutex = &mut.m_mut;
   int res = 0;
   res = pthread_cond_timedwait(&m_condition, pmutex, &ts);
   assert(res == 0 || res == ETIMEDOUT);

   return res != ETIMEDOUT;
}

I don't know which behavior is better, but I suggest it should be the same
for both OSes.

Best Regards,
  Sergei


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk