A nested strict lock is a scoped lock guard ensuring the mutex is locked on its scope, by taking ownership of an nesting lock, locking the mutex on construction if not already locked and restoring the ownership to the nesting lock on destruction. More...
#include <strict_lock.hpp>
Public Types | |
typedef Lock::mutex_type | mutex_type |
Public Member Functions | |
nested_strict_lock (Lock &lk) | |
Constructor from a nesting Lock . More... | |
nested_strict_lock (std::initializer_list< thread_detail::lockable_wrapper< Lock > > l_) | |
~nested_strict_lock () BOOST_NOEXCEPT | |
Destructor. More... | |
mutex_type * | mutex () const BOOST_NOEXCEPT |
return the owned mutex. More... | |
bool | owns_lock () const BOOST_NOEXCEPT |
bool | owns_lock (mutex_type const *l) const BOOST_NOEXCEPT |
A nested strict lock is a scoped lock guard ensuring the mutex is locked on its scope, by taking ownership of an nesting lock, locking the mutex on construction if not already locked and restoring the ownership to the nesting lock on destruction.
typedef Lock::mutex_type boost::nested_strict_lock< Lock >::mutex_type |
|
inlineexplicit |
Constructor from a nesting Lock
.
lk | the nesting lock |
__Requires: lk.mutex() != null_ptr
__Effects: Stores the reference to the lock parameter and takes ownership on it. If the lock doesn't owns the mutex mtx
lock it. __Postconditions: owns_lock
(lk.mutex()) __StrongException __Throws:
lk.lock()
can throw. References boost::interprocess::lock_error, and boost::move().
|
inline |
References boost::interprocess::lock_error, and boost::move().
|
inline |
|
inline |
return the
owned mutex.
Referenced by boost::nested_strict_lock< Lock >::owns_lock().
|
inline |
|
inline |
References boost::nested_strict_lock< Lock >::mutex().