Template mixin that adds ‐Wthread‐safety locking annotations and lock order checking to a subset of the mutex API.

Synopsis

Declared in <sync.h>

template<typename PARENT>
class [[capability]] AnnotatedMixin
    : public PARENT

Base Classes

Name

Description

PARENT

Type Aliases

Name

Description

unique_lock

Unique‐lock type for the wrapped mutex.

Member Functions

Name

Description

~AnnotatedMixin [destructor]

Destroy the mixin and drop its lock‐order bookkeeping.

lock

Lock the underlying mutex.

try_lock

Try to lock the underlying mutex without blocking.

unlock

Unlock the underlying mutex.

operator!

For negative capabilities in the Clang Thread Safety Analysis. A negative requirement uses the EXCLUSIVE_LOCKS_REQUIRED attribute, in conjunction with the ! operator, to indicate that a mutex should not be held.

Created with MrDocs