![]() |
Home | Libraries | People | FAQ | More |
// #include <boost/thread/lock_concepts.hpp> namespace boost { template<typename Lock> class StrictLock; }
A StrictLock is a lock that ensures that the associated mutex is locked during the lifetime of the lock.
A type L
meets the StrictLock
requirements if the following expressions are well-formed and have the
specified semantics
L::mutex_type
is_strict_lock<L>
cl.owns_lock(m);
and BasicLockable<L::mutex_type>
where
cl
denotes a value
of type L const&
,
m
denotes a value of
type L::mutex_type const*
,
The type L::mutex_type denotes the mutex that is locked by this lock.
As the semantic "ensures that the associated mutex is locked during
the lifetime of the lock. " can not be described by syntactic requirements
a is_strict_lock_sur_parole
trait must be specialized by the user defining the lock so that the following
assertion is true:
is_strict_lock_sur_parole<L>::value == true
bool
Whether the strict lock is locking the mutex m
Nothing.
The following classes are models of StrictLock
:
boost::lock_guard
: "sur parole"
as the user could use adopt_lock_t constructor overload without having
locked the mutex.