|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-07-24 09:44:57
"Peter Dimov" <pdimov_at_[hidden]> writes:
> Matt Hurd wrote:
>> On Fri, 23 Jul 2004 08:31:18 +1000, Batov, Vladimir
>> <vladimir.batov_at_[hidden]> wrote:
>>> How 'bout
>>>
>>> scoped_lock lk1(m, defer);
>>> scoped_lock lk2(m, try);
>>
>> no comment except that perhaps scoped_lock can be dropped for just
>> lock. scoped_lock seems so twentieth century ;-)
>
> I like scoped_lock because of:
>
> scoped_lock<> lock( m );
>
> I prefer to be able to name the lock variable 'lock' instead of 'lk'.
Suit yourself, but I think variable names should denote roles, not
types. The type declaration is already there, and otherwise you end
up with glorified hungarian. When there's really no suitable role,
some one or two character identifier works fine, IMO.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk