libstdc++
Collaboration diagram for Mutexes:

Classes

struct  std::adopt_lock_t
 
struct  std::defer_lock_t
 
class  std::lock_guard< _Mutex >
 
class  std::mutex
 
struct  std::try_to_lock_t
 
class  std::unique_lock< _Mutex >
 

Typedefs

typedef __gthread_mutex_t std::__mutex_base::__native_type
 
typedef _Mutex std::lock_guard< _Mutex >::mutex_type
 
typedef _Mutex std::unique_lock< _Mutex >::mutex_type
 
typedef __native_type * std::mutex::native_handle_type
 

Functions

 std::__mutex_base::__mutex_base (const __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::unique_lock< _Mutex >::unique_lock (const unique_lock &)=delete
 
 std::unique_lock< _Mutex >::unique_lock (mutex_type &__m)
 
 std::unique_lock< _Mutex >::unique_lock (mutex_type &__m, adopt_lock_t) noexcept
 
template<typename _Rep , typename _Period >
 std::unique_lock< _Mutex >::unique_lock (mutex_type &__m, const chrono::duration< _Rep, _Period > &__rtime)
 
template<typename _Clock , typename _Duration >
 std::unique_lock< _Mutex >::unique_lock (mutex_type &__m, const chrono::time_point< _Clock, _Duration > &__atime)
 
 std::unique_lock< _Mutex >::unique_lock (mutex_type &__m, defer_lock_t) noexcept
 
 std::unique_lock< _Mutex >::unique_lock (mutex_type &__m, try_to_lock_t)
 
 std::unique_lock< _Mutex >::unique_lock (unique_lock &&__u) noexcept
 
void std::mutex::lock ()
 
void std::unique_lock< _Mutex >::lock ()
 
mutex_type * std::unique_lock< _Mutex >::mutex () const noexcept
 
native_handle_type std::mutex::native_handle () noexcept
 
 std::unique_lock< _Mutex >::operator bool () const noexcept
 
__mutex_base & std::__mutex_base::operator= (const __mutex_base &)=delete
 
lock_guardstd::lock_guard< _Mutex >::operator= (const lock_guard &)=delete
 
mutexstd::mutex::operator= (const mutex &)=delete
 
unique_lockstd::unique_lock< _Mutex >::operator= (const unique_lock &)=delete
 
unique_lockstd::unique_lock< _Mutex >::operator= (unique_lock &&__u) noexcept
 
bool std::unique_lock< _Mutex >::owns_lock () const noexcept
 
mutex_type * std::unique_lock< _Mutex >::release () noexcept
 
void std::unique_lock< _Mutex >::swap (unique_lock &__u) noexcept
 
template<typename _Mutex >
void std::swap (unique_lock< _Mutex > &__x, unique_lock< _Mutex > &__y) noexcept
 
bool std::unique_lock< _Mutex >::try_lock ()
 
bool std::mutex::try_lock () noexcept
 
template<typename _Rep , typename _Period >
bool std::unique_lock< _Mutex >::try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)
 
template<typename _Clock , typename _Duration >
bool std::unique_lock< _Mutex >::try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime)
 
void std::mutex::unlock ()
 
void std::unique_lock< _Mutex >::unlock ()
 

Variables

__native_type std::__mutex_base::_M_mutex
 
_GLIBCXX17_INLINE constexpr adopt_lock_t std::adopt_lock
 
_GLIBCXX17_INLINE constexpr defer_lock_t std::defer_lock
 
_GLIBCXX17_INLINE constexpr try_to_lock_t std::try_to_lock
 
using std::__shared_timed_mutex_base = __shared_mutex_cv
 
template<typename _Mutex >
void std::swap (shared_lock< _Mutex > &__x, shared_lock< _Mutex > &__y) noexcept
 
#define __cpp_lib_shared_timed_mutex
 

Detailed Description

Classes for mutex support.

Macro Definition Documentation

◆ __cpp_lib_shared_timed_mutex

#define __cpp_lib_shared_timed_mutex

Swap specialization for shared_lock.

Definition at line 57 of file shared_mutex.

Typedef Documentation

◆ __native_type

typedef __gthread_mutex_t std::__mutex_base::__native_type
protected

Definition at line 63 of file std_mutex.h.

◆ __shared_timed_mutex_base

Swap specialization for shared_lock.

Definition at line 355 of file shared_mutex.

◆ mutex_type [1/2]

template<typename _Mutex >
typedef _Mutex std::lock_guard< _Mutex >::mutex_type

Definition at line 159 of file std_mutex.h.

◆ mutex_type [2/2]

template<typename _Mutex >
typedef _Mutex std::unique_lock< _Mutex >::mutex_type

Definition at line 188 of file std_mutex.h.

◆ native_handle_type

typedef __native_type* std::mutex::native_handle_type

Definition at line 89 of file std_mutex.h.

Function Documentation

◆ __mutex_base()

std::__mutex_base::__mutex_base ( )
inlineprotectednoexcept

Definition at line 72 of file std_mutex.h.

◆ lock_guard() [1/2]

template<typename _Mutex >
std::lock_guard< _Mutex >::lock_guard ( mutex_type &  __m)
inlineexplicit

Definition at line 161 of file std_mutex.h.

◆ lock_guard() [2/2]

template<typename _Mutex >
std::lock_guard< _Mutex >::lock_guard ( mutex_type &  __m,
adopt_lock_t   
)
inlinenoexcept

Definition at line 164 of file std_mutex.h.

◆ unique_lock() [1/8]

template<typename _Mutex >
std::unique_lock< _Mutex >::unique_lock ( )
inlinenoexcept

Definition at line 190 of file std_mutex.h.

◆ unique_lock() [2/8]

template<typename _Mutex >
std::unique_lock< _Mutex >::unique_lock ( mutex_type &  __m)
inlineexplicit

Definition at line 194 of file std_mutex.h.

◆ unique_lock() [3/8]

template<typename _Mutex >
std::unique_lock< _Mutex >::unique_lock ( mutex_type &  __m,
adopt_lock_t   
)
inlinenoexcept

Definition at line 209 of file std_mutex.h.

◆ unique_lock() [4/8]

template<typename _Mutex >
template<typename _Rep , typename _Period >
std::unique_lock< _Mutex >::unique_lock ( mutex_type &  __m,
const chrono::duration< _Rep, _Period > &  __rtime 
)
inline

Definition at line 223 of file std_mutex.h.

◆ unique_lock() [5/8]

template<typename _Mutex >
template<typename _Clock , typename _Duration >
std::unique_lock< _Mutex >::unique_lock ( mutex_type &  __m,
const chrono::time_point< _Clock, _Duration > &  __atime 
)
inline

Definition at line 216 of file std_mutex.h.

◆ unique_lock() [6/8]

template<typename _Mutex >
std::unique_lock< _Mutex >::unique_lock ( mutex_type &  __m,
defer_lock_t   
)
inlinenoexcept

Definition at line 201 of file std_mutex.h.

◆ unique_lock() [7/8]

template<typename _Mutex >
std::unique_lock< _Mutex >::unique_lock ( mutex_type &  __m,
try_to_lock_t   
)
inline

Definition at line 205 of file std_mutex.h.

◆ unique_lock() [8/8]

template<typename _Mutex >
std::unique_lock< _Mutex >::unique_lock ( unique_lock< _Mutex > &&  __u)
inlinenoexcept

Definition at line 238 of file std_mutex.h.

◆ ~__mutex_base()

std::__mutex_base::~__mutex_base ( )
inlineprotectednoexcept

Definition at line 78 of file std_mutex.h.

◆ ~lock_guard()

template<typename _Mutex >
std::lock_guard< _Mutex >::~lock_guard ( )
inline

Definition at line 167 of file std_mutex.h.

◆ ~unique_lock()

template<typename _Mutex >
std::unique_lock< _Mutex >::~unique_lock ( )
inline

Definition at line 229 of file std_mutex.h.

◆ lock() [1/2]

void std::mutex::lock ( )
inline

Definition at line 101 of file std_mutex.h.

◆ lock() [2/2]

template<typename _Mutex >
void std::unique_lock< _Mutex >::lock ( )
inline

Definition at line 259 of file std_mutex.h.

◆ mutex()

template<typename _Mutex >
mutex_type * std::unique_lock< _Mutex >::mutex ( ) const
inlinenoexcept

Definition at line 352 of file std_mutex.h.

◆ native_handle()

native_handle_type std::mutex::native_handle ( )
inlinenoexcept

Definition at line 125 of file std_mutex.h.

◆ operator bool()

template<typename _Mutex >
std::unique_lock< _Mutex >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 348 of file std_mutex.h.

◆ operator=()

template<typename _Mutex >
unique_lock & std::unique_lock< _Mutex >::operator= ( unique_lock< _Mutex > &&  __u)
inlinenoexcept

Definition at line 245 of file std_mutex.h.

◆ owns_lock()

template<typename _Mutex >
bool std::unique_lock< _Mutex >::owns_lock ( ) const
inlinenoexcept

Definition at line 345 of file std_mutex.h.

◆ release()

template<typename _Mutex >
mutex_type * std::unique_lock< _Mutex >::release ( )
inlinenoexcept

Definition at line 336 of file std_mutex.h.

◆ swap() [1/3]

template<typename _Mutex >
void std::swap ( shared_lock< _Mutex > &  __x,
shared_lock< _Mutex > &  __y 
)
noexcept

Swap specialization for shared_lock.

Definition at line 676 of file shared_mutex.

◆ swap() [2/3]

template<typename _Mutex >
void std::unique_lock< _Mutex >::swap ( unique_lock< _Mutex > &  __u)
inlinenoexcept

Definition at line 329 of file std_mutex.h.

◆ swap() [3/3]

template<typename _Mutex >
void std::swap ( unique_lock< _Mutex > &  __x,
unique_lock< _Mutex > &  __y 
)
inlinenoexcept

Swap overload for unique_lock objects.

Definition at line 363 of file std_mutex.h.

◆ try_lock() [1/2]

template<typename _Mutex >
bool std::unique_lock< _Mutex >::try_lock ( )
inline

Definition at line 273 of file std_mutex.h.

◆ try_lock() [2/2]

bool std::mutex::try_lock ( )
inlinenoexcept

Definition at line 111 of file std_mutex.h.

◆ try_lock_for()

template<typename _Mutex >
template<typename _Rep , typename _Period >
bool std::unique_lock< _Mutex >::try_lock_for ( const chrono::duration< _Rep, _Period > &  __rtime)
inline

Definition at line 303 of file std_mutex.h.

◆ try_lock_until()

template<typename _Mutex >
template<typename _Clock , typename _Duration >
bool std::unique_lock< _Mutex >::try_lock_until ( const chrono::time_point< _Clock, _Duration > &  __atime)
inline

Definition at line 288 of file std_mutex.h.

◆ unlock() [1/2]

void std::mutex::unlock ( )
inline

Definition at line 118 of file std_mutex.h.

◆ unlock() [2/2]

template<typename _Mutex >
void std::unique_lock< _Mutex >::unlock ( )
inline

Definition at line 317 of file std_mutex.h.

Variable Documentation

◆ _M_mutex

__native_type std::__mutex_base::_M_mutex
protected

Definition at line 70 of file std_mutex.h.

◆ adopt_lock

_GLIBCXX17_INLINE constexpr adopt_lock_t std::adopt_lock
constexpr

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

Definition at line 148 of file std_mutex.h.

◆ defer_lock

_GLIBCXX17_INLINE constexpr defer_lock_t std::defer_lock
constexpr

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

Definition at line 142 of file std_mutex.h.

◆ try_to_lock

_GLIBCXX17_INLINE constexpr try_to_lock_t std::try_to_lock
constexpr

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

Definition at line 145 of file std_mutex.h.