Boost logo

Boost :

From: Batov, Vladimir (Vladimir.Batov_at_[hidden])
Date: 2004-07-15 17:00:59


> Christopher Currie wrote:
> > I can infer that the apparent justification for unification would be
to
> > allow a single lock to be used in different ways, but I have a hard
time
> > imagining a use case where this would be as clear and as
error-resistant
> > as separate scopes with separate locks. If anyone has one, or any
other
> > rationale, please respond.
>
> The main motivation behind the idea of unifying the lock types (and
> mutex types) is simplification of concepts, I believe.
>
> Mike

[Batov, Vladimir] I would not call it 'simplification' as it can send a
wrong message but rather 'streamlining'. It's because conceptually (and
in implementation)

try_lock = timed_lock(time=0)
scoped_lock = timed_lock(time=infinite)

Although I have to agree that from user perspective those locks are
distinct and it makes sense to me to provide thin timed_lock, try_lock,
blocking_lock interfaces for the majority of mainstream uses.


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