The Mutex
concept extends the Lockable
concept to include inter-thread synchronization.
Lockable
DefaultConstructible
Destructible
For object m
of Mutex
type.
m.lock()
has the following properties m.unlock()
operations on the same mutex synchronize-with this lock operation (equivalent to release-acquire std::memory_order
) std::recursive_mutex
or std::recursive_timed_mutex
) std::system_error
may be thrown on errors, with the following error codes: std::errc::operation_not_permitted
if the calling thread does not have required privileges std::errc::resource_deadlock_would_occur
if the implementation detects that this operation would lead to deadlock
| (until C++17) |
m.try_lock()
has the following properties try_lock()
succeeds, prior unlock()
operations on the same object synchronize-with this operation (equivalent to release-acquire std::memory_order
). lock()
does not synchronize with a failed try_lock()
m.unlock()
has the following properties The following standard library types satisfy Mutex
:
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/concept/Mutex