C++11 compliant implementation of unique lock. More...
C++11 compliant implementation of unique lock.
#include <mutex.hpp>
Public Types | |
using | mutex_type = Mutex |
The type of Mutex used by the lock. | |
Public Member Functions | |
unique_lock (mutex_type &mtx) | |
Constructs a unique_lock from a Mutex and locks it. | |
unique_lock (mutex_type &mtx, defer_lock_t) noexcept | |
Constructs a unique_lock from a Mutex but does not lock it. | |
unique_lock (mutex_type &mtx, try_to_lock_t) | |
Constructs a unique_lock from a Mutex and tries to lock it. | |
unique_lock (mutex_type &mtx, adopt_lock_t) | |
Constructs a unique_lock from a Mutex that is already owned by the thread. | |
unique_lock (unique_lock &&lock) noexcept | |
Move constructor. | |
unique_lock & | operator= (unique_lock &&lock) noexcept |
Move assignment operator. | |
void | lock () |
Locks the associated mutex. | |
bool | try_lock () |
Tries to lock the associated mutex. | |
void | unlock () |
Unlocks the associated mutex. | |
void | swap (unique_lock &lock) noexcept |
Swap this unique_lock with another unique_lock. | |
mutex_type * | release () noexcept |
Disassociate this lock from its mutex. | |
bool | owns_lock () const noexcept |
Query ownership of the associate mutex. | |
operator bool () const noexcept | |
Operator to query the ownership of the associated mutex. | |
mutex_type * | mutex () const noexcept |
Provides access to the associated mutex. | |
using riot::unique_lock< Mutex >::mutex_type = Mutex |
|
inlinenoexcept |
|
inlineexplicit |
Constructs a unique_lock from a Mutex and locks it.
|
inlinenoexcept |
Constructs a unique_lock from a Mutex but does not lock it.
|
inline |
Constructs a unique_lock from a Mutex and tries to lock it.
|
inline |
Constructs a unique_lock from a Mutex that is already owned by the thread.
|
inline |
|
inlinenoexcept |
void riot::unique_lock< Mutex >::lock | ( | ) |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Swap this unique_lock with another unique_lock.
bool riot::unique_lock< Mutex >::try_lock | ( | ) |
void riot::unique_lock< Mutex >::unlock | ( | ) |