Boost logo

Boost :

From: Vesa Karvonen (vesa.karvonen_at_[hidden])
Date: 2001-07-21 20:14:35


From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> Vesa Karvonen wrote:
> > Personally, I have been using a class template 'locked',
> > which is basically a handle to a lockable or guarded
> > object/resource. It is similar to, but not the same as, the
> > LockingPtr presented in
> > http://www.cuj.com/experts/1902/alexandr.htm?topic=experts.
> > The main implementation difference is that lockable only
> > stores a single pointer.

Actually, 'locked' doesn't use the volatile/const_cast<> thing either, which
can be thought of as being even more significant. However, the basic intent
behind 'locked', 'LockingPtr', and 'locking_ptr' is the same.

[snip]
> There was a long thread in news:comp.lang.c++.moderated regarding the
> Andrei's LockingPtr technique, and I believe that 'need_locking' class
> template described in the following article:
>
> http://groups.google.com/groups?th=9e0488ed4f4a80f4,426&rnum=185&selm=94ccng
> %24m2t%241%40nnrp1.deja.com
>
> is pretty much equivalent to your 'guarded' class.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk