|
Boost : |
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-07-19 04:15:15
> So long as we have a "lock" concept...
what you currently have is the concept known
to everyone and his dog as SCOPED LOCKING.
which is simply a convenient way to deal with
(acq/rel) LOCKS (mutexes, semaphores,
read/write locks, spinlocks,...).
e.g. POSA2, Pg. 325:
"Scoped Locking C++ idiom ensures that
a *LOCK* is acquired when control enters
a scope and released automatically
when control leaves the scope,
regardless of the return path from
the scope."
note that this concept alone is somewhat
less robust/helpful than POSIX cancellation
cleanup handlers; releasing the lock with
associated data left in broken state is not
really helpful.. btw, that is why win32
ABANDONED mutex state is practically
useless and is rather brain damaged
concept, IMHO.
regards,
alexander.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk