
26 Jul
2004
26 Jul
'04
1:04 a.m.
"Peter Dimov" <pdimov@mmltd.net> 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