C++ named requirements: SharedMutex (since C++17) (original) (raw)

The SharedMutex requirements extend the Mutex requirements to include shared lock ownership mode.

[edit] Requirements

Additionally, an object **m** of SharedMutex type supports another mode of ownership: shared. Multiple threads (or, more generally, execution agents) can simultaneously own this mutex in shared mode, but no thread may obtain shared ownership if there is a thread that owns it in exclusive mode and no thread may obtain exclusive ownership if there is a thread that owns it in shared mode. If more than implementation-defined number of threads (no less than 10000) hold a shared lock, another attempt to acquire the mutex in shared mode blocks until the number of shared owners drops down below that threshold.

[edit] Standard library

The following standard library types satisfy SharedMutex requirements:

[edit] See also