21 #ifndef THREADPOOL_DETAIL_LOCKING_PTR_HPP_INCLUDED 22 #define THREADPOOL_DETAIL_LOCKING_PTR_HPP_INCLUDED 24 #include <boost/utility.hpp> 25 #include <boost/thread/mutex.hpp> 28 namespace boost {
namespace threadpool {
namespace detail
36 template <
typename T,
typename Mutex>
46 : m_obj(const_cast<T*>(&obj))
47 , m_mutex(*const_cast<Mutex*>(&mtx))
84 #endif // THREADPOOL_DETAIL_LOCKING_PTR_HPP_INCLUDED The namespace threadpool contains a thread pool and related utility classes.
Smart pointer with a scoped locking mechanism.
~locking_ptr()
Destructor.
Mutex & m_mutex
Mutex is used for scoped locking.
locking_ptr(volatile T &obj, const volatile Mutex &mtx)
Constructor.
T * m_obj
The instance pointer.