Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-02-20 10:40:01


AMDG

Bernard Maassen wrote:
> Hi all
>
> i'm porting a program written in visual studio 2005 to vs 2003, and
> came to a problem i can't
> fix.
>
> The idea is to have a lock a mutex while a object excists. The code is:
>
> template <class B>
> class BaseReadLockProxy
> {
> private:
> const B& base;
> typename B::MutexType::scoped_lock baseScoped_lock;
>
>
> public:
> BaseReadLockProxy(const B& b):
> base(b),
> baseScoped_lock( B::MutexType::scoped_lock(b.baseMutex))

try baseScoped_lock(b.baseMutex)

> {
> }
>
> typename const B::ContainerType& getItems()
> {
> return base.getItems();
> }
>
> ~BaseReadLockProxy()
> {
> }
> };

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net