
From: Howard Hinnant [mailto:hinnant@twcny.rr.com]
I mostly agree with Bronek Kozicki. Given a movable lock, Eric Niebler's proposal:
scoped_lock try_lock( Mutex & m ); scoped_lock timed_lock( Mutex & m );
is a better try/timed interface. Heisenberg constructors must die.
Sorry, I don't know what a Heisenberg constructor is.
It's a reference to the Heisenberg uncertainty principle. Constructors that sometimes act one way and sometimes another must die. ;)
From: David Abrahams [mailto:dave@boost-consulting.com] Howard Hinnant <hinnant@twcny.rr.com> writes:
scoped_lock lk1(m, defer_lock); // not locked ^^^^ ^^^^ Redundant. "deferred" is better.
If you named it not_locked you wouldn't need the comment. ;) Of these three choices: 1. try, deferred 2. try_lock, deferred 3. try_lock, defer_lock I tend to like #3 the best. Glen