[thread.sharedmutex.class] (original) (raw)
32 Concurrency support library [thread]
32.6 Mutual exclusion [thread.mutex]
32.6.4 Mutex requirements [thread.mutex.requirements]
32.6.4.4 Shared mutex types [thread.sharedmutex.requirements]
32.6.4.4.2 Class shared_mutex [thread.sharedmutex.class]
namespace std { class shared_mutex { public: shared_mutex();~shared_mutex(); shared_mutex(const shared_mutex&) = delete; shared_mutex& operator=(const shared_mutex&) = delete;void lock(); bool try_lock();void unlock();void lock_shared(); bool try_lock_shared();void unlock_shared();using native_handle_type = implementation-defined; native_handle_type native_handle(); };}
The class shared_mutex provides a non-recursive mutex with shared ownership semantics.
The behavior of a program is undefined if
- it destroys a shared_mutex object owned by any thread,
- a thread attempts to recursively gain any ownership of a shared_mutex, or
- a thread terminates while possessing any ownership of a shared_mutex.
shared_mutex may be a synonym for shared_timed_mutex.