Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::StrictLock< Lk > Struct Template Reference

An StrictLock is a scoped lock guard ensuring the mutex is locked on the scope of the lock, by locking the mutex on construction and unlocking it on destruction. More...

#include <lock_concepts.hpp>

Public Types

typedef Lk::mutex_type mutex_type
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((BasicLockable< mutex_type >))
 
 BOOST_STATIC_ASSERT ((is_strict_lock< Lk >::value))
 
 BOOST_CONCEPT_USAGE (StrictLock)
 
 StrictLock ()
 

Detailed Description

template<typename Lk>
struct boost::StrictLock< Lk >

An StrictLock is a scoped lock guard ensuring the mutex is locked on the scope of the lock, by locking the mutex on construction and unlocking it on destruction.

Essentially, a StrictLock's role is only to live on the stack as an automatic variable. strict_lock must adhere to a non-copy and non-alias policy. StrictLock disables copying by making the copy constructor and the assignment operator private. While we're at it, let's disable operator new and operator delete; strict locks are not intended to be allocated on the heap. StrictLock avoids aliasing by using a slightly less orthodox and less well-known technique: disable address taking.

Member Typedef Documentation

template<typename Lk >
typedef Lk::mutex_type boost::StrictLock< Lk >::mutex_type

Constructor & Destructor Documentation

template<typename Lk >
boost::StrictLock< Lk >::StrictLock ( )
inline

Member Function Documentation

template<typename Lk >
boost::StrictLock< Lk >::BOOST_CONCEPT_ASSERT ( (BasicLockable< mutex_type >)  )
template<typename Lk >
boost::StrictLock< Lk >::BOOST_CONCEPT_USAGE ( StrictLock< Lk >  )
inline
template<typename Lk >
boost::StrictLock< Lk >::BOOST_STATIC_ASSERT ( (is_strict_lock< Lk >::value)  )

The documentation for this struct was generated from the following file: