UniqueLock

Wrapper around std::unique_lock style lock for MutexType.

Synopsis

Declared in <sync.h>

template<typename MutexType>
class [[scoped_lockable]] UniqueLock
    : public MutexType::unique_lock

Base Classes

NameDescription
MutexType::unique_lock

Types

NameDescription
reverse_lock An RAII-style reverse lock. Unlocks on construction and locks on destruction.

Member Functions

NameDescription
UniqueLock [constructor]Acquire a lock on the given mutex, registering it for lock-order checking.
UniqueLock [constructor]Acquire a lock on the given mutex pointer, doing nothing if it is null.
~UniqueLock [destructor]Release the lock if held and update lock-order bookkeeping.
operator bool Report whether this lock currently owns its mutex.

Protected Member Functions

NameDescription
UniqueLock [constructor]Construct an empty lock that owns no mutex (needed for reverse_lock).

Friends

NameDescription
UniqueLock::reverse_lockAn RAII-style reverse lock. Unlocks on construction and locks on destruction.