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

Name

Description

MutexType::unique_lock

Types

Name

Description

reverse_lock

An RAII‐style reverse lock. Unlocks on construction and locks on destruction.

Member Functions

Name

Description

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

Name

Description

UniqueLock [constructor]

Construct an empty lock that owns no mutex (needed for reverse_lock).

Friends

Name

Description

UniqueLock::reverse_lock

An RAII‐style reverse lock. Unlocks on construction and locks on destruction.

Created with MrDocs