Boost logo

Boost :

From: Wolfgang Fertsak (wolfgang.fertsak_at_[hidden])
Date: 2008-09-02 05:04:40


In boost 1.35 and 1.36 the implementation of mutex::timed_lock() and
recursive_mutex::timed_lock() for posix-platforms with
BOOST_PTHREAD_HAS_TIMEDLOCK defined looks like this:

bool timed_lock(system_time const & abs_time)
{
     struct timespec const timeout=detail::get_timespec(abs_time);
     int const res=pthread_mutex_timedlock(&m,&timeout);
     BOOST_ASSERT(!res || res==EBUSY);
     return !res;
}
The assertion following pthread_mutex_timedlock() always fails in case
of a timeout since the system call returns ETIMEDOUT when timed out and
not EBUSY (according to the open group specification
http://www.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_timedlock.html)

Best regards,
Wolfgang


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