
Hi: I have the following variable declared in a class: Boost::shared_ptr<boost;:shared_mutex> If I have a standard boost::shared_mutex, I can pass this to a shared or unique lock. How do I pass a boost::shared_ptr<boost::shared_mutex> to a lock? This is probably really simple, but I carn't fathum it out! Cheers Sean.

I have the following variable declared in a class:
Boost::shared_ptr<boost;:shared_mutex>
If I have a standard boost::shared_mutex, I can pass this to a shared or unique lock.
How do I pass a boost::shared_ptr<boost::shared_mutex> to a lock?
This is probably really simple, but I carn’t fathum it out!
#include <boost/thread/locks.hpp> #include <boost/thread/shared_mutex.hpp> #include <boost/shared_ptr.hpp> int main() { using namespace boost; shared_ptr<shared_mutex> pMutex; unique_lock<shared_mutex> lock(*pMutex); }
participants (2)
-
Igor R
-
Sean Farrow