|
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
{
public:
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
idiom.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk