Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2003-07-22 09:42:44


Peter Dimov wrote:
[...]
> Double calls to pthread_mutex_lock are the equivalent of doing
>
> scoped_lock l1(m);
> scoped_lock l2(m);
>
> This is already undefined behavior when m is boost::mutex according to the
> mutex requirements; m is not required to check for deadlocks.

Okay.

> We are discussing the
>
> scoped_lock l1(m);
> l1.lock();
>
> case. Since l1 is required to know whether it's been locked or not (it has a
> public locked() query) it can easily check.

What for? http://www.terekhov.de/DESIGN-futex-CV.cpp (see
mutex::guard and mutex::release_guard). I guess that I'm just
missing and/or misunderstanding something... oder?

regards,
alexander.


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