#ifndef __SCOPEDLOCKHOLDER__ #define __SCOPEDLOCKHOLDER__ #include #include #include class ScopedLock { protected: mutable boost::shared_ptr > mHolder; public: ScopedLock(boost::recursive_mutex &mutex) : mHolder(new boost::interprocess::scoped_lock(mutex)) { ; } void lock() const { mHolder->lock(); } void unlock() const { mHolder->unlock(); } }; #endif