folly::AnnotatedMutex

A std::mutex wrapper carrying the capability("mutex") attribute.

Synopsis

Declared in <folly/synchronization/ThreadAnnotations.h>

class AnnotatedMutex;

Description

std::mutex wrapper carrying the capability("mutex") attribute so Clang's -Wthread-safety analysis can verify FOLLY_TS_GUARDED_BY / FOLLY_TS_EXCLUDES claims involving it. Behaves exactly like std::mutex at runtime.

Member Functions

NameDescription
AnnotatedMutex [constructor]Constructors
~AnnotatedMutex [destructor]Destroys the mutex.
operator= Assignment operators
lock Acquires the mutex.
try_lock Attempts to acquire the mutex without blocking.
unlock Releases the mutex.
operator! Returns the mutex itself to express negative capabilities.