The SharedMutex requirements extend the Mutex requirements to include shared lock ownership mode.
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.
m.lock_shared()has the following properties
m.unlock()operations on the same mutex synchronize-with this lock operation (equivalent to release-acquire
m.try_lock_shared()has the following properties
unlock()operations on the same object synchronize-with this operation (equivalent to release-acquire
m.unlock_shared()has the following properties
The following standard library types satisfy SharedMutex:
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.