Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-07-08 06:56:08

Eric Niebler wrote:
> How about:
> if( ScopedLock l = try_lock( m ) )
> {
> }

You know that I very much favor declarations in conditions, but this is a
whole new design, one that uses moveable locks. Something like:

class Mutex

    AutoLock lock();
    AutoLock try_lock();
    AutoLock timed_lock( xtime );

One might argue that a lock is naturally moveable... but I think that we
should constrain ourselves to (fixing) the current noncopyable scoped_lock

Boost list run by bdawes at, gregod at, cpdaniel at, john at