Boost logo

Boost :

From: Dietmar Kuehl (dietmar_kuehl_at_[hidden])
Date: 2000-08-08 15:43:23


Hi,

--- scleary_at_[hidden] wrote:
> The "mutex" class is not designed to ensure unlocking the mutex,
> but rather the destruction of the mutex when it is no longer needed.

Sure. But using the 'Lock()' method, a lock can be acquired which is
not automatically released. This is what I'm opposed to! It is an error
to hold a lock longer than for a very local scope. With a requirement
for manual unlocking, you will definitely get into trouble if
exceptions enter the picture. Thus, I would remove all methods which
lock a mutex without also ensuring that it is unlocked later. The only
way to lock a mutex would be through creation of an object which
releases the lock if it goes out of scope.

=====
<mailto:dietmar_kuehl_at_[hidden]>
<http://www.dietmar-kuehl.de/>

__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/


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