Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-07-25 20:04:58


"Peter Dimov" <pdimov_at_[hidden]> writes:

>>> 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.
>
> Hm. What is it that makes 'lock' not qualify as a role?

Well, OK, it's a role at a very low level of abstraction. Something
more like "access_foo" for some mutex-protected resource "foo" might
be better. For that matter, unlock() maybe ought to be release().
Hmm, a smart-pointerish model has some appeal for me. They are our
canonical resource managers.

Cheers,

-- 
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