
20 Feb
2008
20 Feb
'08
3:40 p.m.
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