Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2007-11-15 10:24:58


Howard Hinnant wrote:
>
> On Nov 15, 2007, at 7:02 AM, Alexander Terekhov wrote:
>
> >> http://svn.boost.org/svn/boost/trunk/boost/thread/pthread/condition_variable.hpp
> >
> > That condition_variable_any wrapper doesn't ensure same destruction
> > safety of condition varaible as POSIX pthread_cond_t. That's not good.
>
> Thanks for this observation Alexander. Do you have a recommendation
> for fixing it? The best I'm coming up with at the moment is to keep a
> count of waiters as member data and have ~condition_variable_any()
> wait until the count drops to zero.

Or simply use shared_ptr<pthread_mutex_t> for internal_mutex. Peter
will like that. :-)

BTW, condition_variable_any's (timed_}wait() above doesn't seem to
m.lock() in the case of threads cancel (interruption). That doesn't
match POSIX (and condition_variable thin wrapper) behavior.

regards,
alexander.


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