From: William Kempf (williamkempf_at_[hidden])
Date: 2002-05-19 13:50:24
>From: Eric D Crahen <crahen_at_[hidden]>
>I mean that the lock is owned, created and destroyed by the GuardedObject
>only. That's the important scope I was talking about.
Hmm... hadn't quite thought of it in those terms. The locking_ptr<> need
only contain two members, a mutex and a scoped_lock, and the proxy would
hold a reference to the scoped_lock. A little dangerous because this shares
the lock object across threads... but the idiom may be made to work. Then
the question remains, are there other examples/use cases where the lock must
be locked in one scope and unlocked in another where a similar idiom won't
I guess for now I'm going to table this until other examples can be found.
Chat with friends online, try MSN Messenger: http://messenger.msn.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk