
From: Howard Hinnant <hinnant@twcny.rr.com>
Oh, I just remembered another reason I chose defer_lock over deferred. I was trying to be symmetric with the try-counterpart:
scoped_lock lk1(m, defer_lock); scoped_lock lk2(m, try_lock);
vs:
scoped_lock lk1(m, deferred); scoped_lock lk2(m, tried);
<shrug> I disliked "tried" more than I liked "deferred". And I also felt that the benefit of symmetry was important to make the interface easier to learn.
Actually, I think "deferred" and "tried" are better. The reason is that they say that locking of a lock so constructed was "deferred" or "tried." The latter doesn't indicate whether the attempt to lock succeeded, just that there was an attempt. From: Michael Glassford <glassfordm@hotmail.com>
Another possibility is to name the second parameter as an adjective describing the initial state of the lock instead of a verb:
scoped_lock l(m, unlocked);
This, seems even better; it's at least easier to explain! scoped_lock lk1(m, unlocked); scoped_lock lk2(m, tried); -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;