|
Boost : |
Subject: Re: [boost] [interprocess] difference in timed_wait behavior under linux and windows
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-09-19 13:30:04
Sergei Politov wrote:
> 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;
> }
Thanks for the report. I just didn't know pos_infin was there. I would
need to call non-timed versions when pos_infin is used. That would be
correct, wouldn't it?
> I don't know which behavior is better, but I suggest it should be the same
> for both OSes.
>
> Best Regards,
> Sergei
Regards,
Ion
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk