C++ named requirements: Mutex (since C++11) (original) (raw)

The Mutex requirements extends the Lockable requirements to include inter-thread synchronization.

[edit] Requirements

For an object **m** of Mutex type:

[edit] Standard library

The following standard library types satisfy Mutex requirements:

mutex(C++11) provides basic mutual exclusion facility (class) [edit]
recursive_mutex(C++11) provides mutual exclusion facility which can be locked recursively by the same thread (class) [edit]
recursive_timed_mutex(C++11) provides mutual exclusion facility which can be locked recursivelyby the same thread and implements locking with a timeout (class) [edit]
shared_mutex(C++17) provides shared mutual exclusion facility (class) [edit]
shared_timed_mutex(C++14) provides shared mutual exclusion facility and implements locking with a timeout (class) [edit]
timed_mutex(C++11) provides mutual exclusion facility which implements locking with a timeout (class) [edit]

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
LWG 2309 C++11 lock might throw std::system_errorwith error code std::errc::device_or_resource_busy not allowed

[edit] See also