RE: [boost] Re: Lock unification [was: Boost.Threads: Do we need all those mutexes?]

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.
participants (1)
-
Batov, Vladimir