libstdc++
Collaboration diagram for Mutexes:

Macros

#define __cpp_lib_scoped_lock
 
#define __cpp_lib_shared_mutex
 
#define __cpp_lib_shared_timed_mutex
 

Typedefs

typedef __gthread_mutex_t std::__mutex_base::__native_type
 
typedef __gthread_recursive_mutex_t std::__recursive_mutex_base::__native_type
 
typedef _Mutex std::lock_guard< _Mutex >::mutex_type
 
using std::scoped_lock< _Mutex >::mutex_type = _Mutex
 
typedef _Mutex std::shared_lock< _Mutex >::mutex_type
 
typedef __native_type * std::mutex::native_handle_type
 
typedef __native_type * std::recursive_mutex::native_handle_type
 

Functions

 std::__condvar::__condvar (const __condvar &)=delete
 
 std::__mutex_base::__mutex_base (const __mutex_base &)=delete
 
 std::__recursive_mutex_base::__recursive_mutex_base (const __recursive_mutex_base &)=delete
 
 std::lock_guard< _Mutex >::lock_guard (const lock_guard &)=delete
 
 std::lock_guard< _Mutex >::lock_guard (mutex_type &__m)
 
 std::lock_guard< _Mutex >::lock_guard (mutex_type &__m, adopt_lock_t) noexcept
 
 std::mutex::mutex (const mutex &)=delete
 
 std::once_flag::once_flag (const once_flag &)=delete
 
 std::recursive_mutex::recursive_mutex (const recursive_mutex &)=delete
 
 std::recursive_timed_mutex::recursive_timed_mutex (const recursive_timed_mutex &)=delete
 
 std::scoped_lock< _MutexTypes >::scoped_lock (_MutexTypes &... __m)
 
 std::scoped_lock<>::scoped_lock (adopt_lock_t) noexcept
 
 std::scoped_lock< _MutexTypes >::scoped_lock (adopt_lock_t, _MutexTypes &... __m) noexcept
 
 std::scoped_lock< _Mutex >::scoped_lock (adopt_lock_t, mutex_type &__m) noexcept
 
 std::scoped_lock< _MutexTypes >::scoped_lock (const scoped_lock &)=delete
 
 std::scoped_lock<>::scoped_lock (const scoped_lock &)=delete
 
 std::scoped_lock< _Mutex >::scoped_lock (const scoped_lock &)=delete
 
 std::scoped_lock< _Mutex >::scoped_lock (mutex_type &__m)
 
 std::shared_lock< _Mutex >::shared_lock (mutex_type &__m)
 
 std::shared_lock< _Mutex >::shared_lock (mutex_type &__m, adopt_lock_t)
 
template<typename _Rep , typename _Period >
 std::shared_lock< _Mutex >::shared_lock (mutex_type &__m, const chrono::duration< _Rep, _Period > &__rel_time)
 
template<typename _Clock , typename _Duration >
 std::shared_lock< _Mutex >::shared_lock (mutex_type &__m, const chrono::time_point< _Clock, _Duration > &__abs_time)
 
 std::shared_lock< _Mutex >::shared_lock (mutex_type &__m, defer_lock_t) noexcept
 
 std::shared_lock< _Mutex >::shared_lock (mutex_type &__m, try_to_lock_t)
 
 std::shared_lock< _Mutex >::shared_lock (shared_lock &&__sl) noexcept
 
 std::shared_lock< _Mutex >::shared_lock (shared_lock const &)=delete
 
 std::shared_mutex::shared_mutex (const shared_mutex &)=delete
 
 std::shared_timed_mutex::shared_timed_mutex (const shared_timed_mutex &)=delete
 
 std::timed_mutex::timed_mutex (const timed_mutex &)=delete
 
void std::__once_proxy (void)
 
template<typename _Callable , typename... _Args>
void std::call_once (once_flag &__once, _Callable &&__f, _Args &&... __args)
 
void std::mutex::lock ()
 
void std::recursive_mutex::lock ()
 
void std::timed_mutex::lock ()
 
void std::recursive_timed_mutex::lock ()
 
void std::shared_mutex::lock ()
 
void std::shared_timed_mutex::lock ()
 
void std::shared_lock< _Mutex >::lock ()
 
template<typename _L1 , typename _L2 , typename... _L3>
void std::lock (_L1 &__l1, _L2 &__l2, _L3 &... __l3)
 
void std::shared_mutex::lock_shared ()
 
void std::shared_timed_mutex::lock_shared ()
 
mutex_type * std::shared_lock< _Mutex >::mutex () const noexcept
 
native_handle_type std::mutex::native_handle () noexcept
 
__gthread_cond_t * std::__condvar::native_handle () noexcept
 
native_handle_type std::recursive_mutex::native_handle () noexcept
 
void std::__condvar::notify_all () noexcept
 
void std::__condvar::notify_one () noexcept
 
 std::shared_lock< _Mutex >::operator bool () const noexcept
 
bool std::recursive_timed_mutex::_Can_lock::operator() () const noexcept
 
__condvar & std::__condvar::operator= (const __condvar &)=delete
 
__mutex_base & std::__mutex_base::operator= (const __mutex_base &)=delete
 
__recursive_mutex_base & std::__recursive_mutex_base::operator= (const __recursive_mutex_base &)=delete
 
lock_guardstd::lock_guard< _Mutex >::operator= (const lock_guard &)=delete
 
mutexstd::mutex::operator= (const mutex &)=delete
 
once_flagstd::once_flag::operator= (const once_flag &)=delete
 
recursive_mutexstd::recursive_mutex::operator= (const recursive_mutex &)=delete
 
recursive_timed_mutexstd::recursive_timed_mutex::operator= (const recursive_timed_mutex &)=delete
 
scoped_lockstd::scoped_lock< _MutexTypes >::operator= (const scoped_lock &)=delete
 
scoped_lockstd::scoped_lock<>::operator= (const scoped_lock &)=delete
 
scoped_lockstd::scoped_lock< _Mutex >::operator= (const scoped_lock &)=delete
 
shared_mutexstd::shared_mutex::operator= (const shared_mutex &)=delete
 
shared_timed_mutexstd::shared_timed_mutex::operator= (const shared_timed_mutex &)=delete
 
timed_mutexstd::timed_mutex::operator= (const timed_mutex &)=delete
 
shared_lockstd::shared_lock< _Mutex >::operator= (shared_lock &&__sl) noexcept
 
shared_lockstd::shared_lock< _Mutex >::operator= (shared_lock const &)=delete
 
bool std::shared_lock< _Mutex >::owns_lock () const noexcept
 
mutex_type * std::shared_lock< _Mutex >::release () noexcept
 
void std::shared_lock< _Mutex >::swap (shared_lock &__u) noexcept
 
template<typename _Mutex >
void swap (shared_lock< _Mutex > &__x, shared_lock< _Mutex > &__y) noexcept
 
bool std::timed_mutex::try_lock ()
 
bool std::recursive_timed_mutex::try_lock ()
 
bool std::shared_mutex::try_lock ()
 
bool std::shared_timed_mutex::try_lock ()
 
bool std::shared_lock< _Mutex >::try_lock ()
 
bool std::mutex::try_lock () noexcept
 
bool std::recursive_mutex::try_lock () noexcept
 
template<typename _Lock1 , typename _Lock2 , typename... _Lock3>
int std::try_lock (_Lock1 &__l1, _Lock2 &__l2, _Lock3 &... __l3)
 
template<typename _Rep , typename _Period >
bool std::shared_lock< _Mutex >::try_lock_for (const chrono::duration< _Rep, _Period > &__rel_time)
 
template<typename _Rep , typename _Period >
bool std::timed_mutex::try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)
 
template<typename _Rep , typename _Period >
bool std::recursive_timed_mutex::try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)
 
template<typename _Rep , typename _Period >
bool std::shared_timed_mutex::try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)
 
bool std::shared_mutex::try_lock_shared ()
 
bool std::shared_timed_mutex::try_lock_shared ()
 
template<typename _Rep , typename _Period >
bool std::shared_timed_mutex::try_lock_shared_for (const chrono::duration< _Rep, _Period > &__rtime)
 
template<typename _Clock , typename _Duration >
bool std::shared_timed_mutex::try_lock_shared_until (const chrono::time_point< _Clock, _Duration > &__abs_time)
 
template<typename _Clock , typename _Duration >
bool std::shared_timed_mutex::try_lock_until (const chrono::time_point< _Clock, _Duration > &__abs_time)
 
template<typename _Clock , typename _Duration >
bool std::shared_lock< _Mutex >::try_lock_until (const chrono::time_point< _Clock, _Duration > &__abs_time)
 
template<typename _Clock , typename _Duration >
bool std::timed_mutex::try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime)
 
template<typename _Clock , typename _Duration >
bool std::recursive_timed_mutex::try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime)
 
void std::mutex::unlock ()
 
void std::recursive_mutex::unlock ()
 
void std::timed_mutex::unlock ()
 
void std::recursive_timed_mutex::unlock ()
 
void std::shared_mutex::unlock ()
 
void std::shared_timed_mutex::unlock ()
 
void std::shared_lock< _Mutex >::unlock ()
 
void std::shared_mutex::unlock_shared ()
 
void std::shared_timed_mutex::unlock_shared ()
 
void std::__condvar::wait (mutex &__m) noexcept
 
void std::__condvar::wait_until (mutex &__m, timespec &__abs_time) noexcept
 

Variables

thread::id std::recursive_timed_mutex::_Can_lock::_M_caller
 
__gthread_cond_t std::__condvar::_M_cond
 
__native_type std::__mutex_base::_M_mutex
 
__native_type std::__recursive_mutex_base::_M_mutex
 
const recursive_timed_mutexstd::recursive_timed_mutex::_Can_lock::_M_mx
 
constexpr adopt_lock_t std::adopt_lock
 
constexpr defer_lock_t std::defer_lock
 
constexpr try_to_lock_t std::try_to_lock
 

Friends

template<typename _Callable , typename... _Args>
void std::once_flag::call_once (once_flag &__once, _Callable &&__f, _Args &&... __args)
 

Detailed Description

Classes for mutex support.

Function Documentation

◆ once_flag()

std::once_flag::once_flag ( const once_flag )
delete

Deleted copy constructor.

◆ call_once()

template<typename _Callable , typename... _Args>
void std::call_once ( once_flag __once,
_Callable &&  __f,
_Args &&...  __args 
)

Invoke a callable and synchronize with other calls using the same flag.

Definition at line 772 of file mutex.

◆ lock()

template<typename _L1 , typename _L2 , typename... _L3>
void std::lock ( _L1 &  __l1,
_L2 &  __l2,
_L3 &...  __l3 
)

Generic lock.

Parameters
__l1Meets Lockable requirements (try_lock() may throw).
__l2Meets Lockable requirements (try_lock() may throw).
__l3Meets Lockable requirements (try_lock() may throw).
Exceptions
Anexception thrown by an argument's lock() or try_lock() member.
Postcondition
All arguments are locked.

All arguments are locked via a sequence of calls to lock(), try_lock() and unlock(). If the call exits via an exception any locks that were obtained will be released.

Definition at line 591 of file mutex.

◆ operator=()

once_flag& std::once_flag::operator= ( const once_flag )
delete

Deleted assignment operator.

◆ swap()

template<typename _Mutex >
void swap ( shared_lock< _Mutex > &  __x,
shared_lock< _Mutex > &  __y 
)
related

Swap specialization for shared_lock.

Definition at line 851 of file shared_mutex.

◆ try_lock()

template<typename _Lock1 , typename _Lock2 , typename... _Lock3>
int std::try_lock ( _Lock1 &  __l1,
_Lock2 &  __l2,
_Lock3 &...  __l3 
)

Generic try_lock.

Parameters
__l1Meets Lockable requirements (try_lock() may throw).
__l2Meets Lockable requirements (try_lock() may throw).
__l3Meets Lockable requirements (try_lock() may throw).
Returns
Returns -1 if all try_lock() calls return true. Otherwise returns a 0-based index corresponding to the argument that returned false.
Postcondition
Either all arguments are locked, or none will be.

Sequentially calls try_lock() on each argument.

Definition at line 570 of file mutex.

Variable Documentation

◆ adopt_lock

constexpr adopt_lock_t std::adopt_lock
inlineconstexpr

Tag used to make a scoped lock take ownership of a locked mutex.

Definition at line 215 of file std_mutex.h.

◆ defer_lock

constexpr defer_lock_t std::defer_lock
inlineconstexpr

Tag used to prevent a scoped lock from acquiring ownership of a mutex.

Definition at line 209 of file std_mutex.h.

◆ try_to_lock

constexpr try_to_lock_t std::try_to_lock
inlineconstexpr

Tag used to prevent a scoped lock from blocking if a mutex is locked.

Definition at line 212 of file std_mutex.h.

Friends

◆ call_once

template<typename _Callable , typename... _Args>
void call_once ( once_flag __once,
_Callable &&  __f,
_Args &&...  __args 
)
friend

Invoke a callable and synchronize with other calls using the same flag.

Definition at line 772 of file mutex.