Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
absl::Mutex Class Reference

#include <mutex.h>

Public Types

typedef const struct MuHowSMuHow
 
typedef const struct MuHowSMuHow
 

Public Member Functions

void AssertHeld () const ABSL_ASSERT_EXCLUSIVE_LOCK()
 
void AssertHeld () const ABSL_ASSERT_EXCLUSIVE_LOCK()
 
void AssertNotHeld () const
 
void AssertNotHeld () const
 
void AssertReaderHeld () const ABSL_ASSERT_SHARED_LOCK()
 
void AssertReaderHeld () const ABSL_ASSERT_SHARED_LOCK()
 
void Await (const Condition &cond)
 
void Await (const Condition &cond)
 
bool AwaitWithDeadline (const Condition &cond, absl::Time deadline)
 
bool AwaitWithDeadline (const Condition &cond, absl::Time deadline)
 
bool AwaitWithTimeout (const Condition &cond, absl::Duration timeout)
 
bool AwaitWithTimeout (const Condition &cond, absl::Duration timeout)
 
void EnableDebugLog (const char *name)
 
void EnableDebugLog (const char *name)
 
void EnableInvariantDebugging (void(*invariant)(void *), void *arg)
 
void EnableInvariantDebugging (void(*invariant)(void *), void *arg)
 
void ForgetDeadlockInfo ()
 
void ForgetDeadlockInfo ()
 
void Lock () ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void Lock () ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void LockWhen (const Condition &cond) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void LockWhen (const Condition &cond) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool LockWhenWithDeadline (const Condition &cond, absl::Time deadline) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool LockWhenWithDeadline (const Condition &cond, absl::Time deadline) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool LockWhenWithTimeout (const Condition &cond, absl::Duration timeout) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool LockWhenWithTimeout (const Condition &cond, absl::Duration timeout) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
 Mutex ()
 
 Mutex ()
 
constexpr Mutex (absl::ConstInitType)
 
constexpr Mutex (absl::ConstInitType)
 
void ReaderLock () ABSL_SHARED_LOCK_FUNCTION()
 
void ReaderLock () ABSL_SHARED_LOCK_FUNCTION()
 
void ReaderLockWhen (const Condition &cond) ABSL_SHARED_LOCK_FUNCTION()
 
void ReaderLockWhen (const Condition &cond) ABSL_SHARED_LOCK_FUNCTION()
 
bool ReaderLockWhenWithDeadline (const Condition &cond, absl::Time deadline) ABSL_SHARED_LOCK_FUNCTION()
 
bool ReaderLockWhenWithDeadline (const Condition &cond, absl::Time deadline) ABSL_SHARED_LOCK_FUNCTION()
 
bool ReaderLockWhenWithTimeout (const Condition &cond, absl::Duration timeout) ABSL_SHARED_LOCK_FUNCTION()
 
bool ReaderLockWhenWithTimeout (const Condition &cond, absl::Duration timeout) ABSL_SHARED_LOCK_FUNCTION()
 
bool ReaderTryLock () ABSL_SHARED_TRYLOCK_FUNCTION(true)
 
bool ReaderTryLock () ABSL_SHARED_TRYLOCK_FUNCTION(true)
 
void ReaderUnlock () ABSL_UNLOCK_FUNCTION()
 
void ReaderUnlock () ABSL_UNLOCK_FUNCTION()
 
bool TryLock () ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
bool TryLock () ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
void Unlock () ABSL_UNLOCK_FUNCTION()
 
void Unlock () ABSL_UNLOCK_FUNCTION()
 
void WriterLock () ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void WriterLock () ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void WriterLockWhen (const Condition &cond) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void WriterLockWhen (const Condition &cond) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterLockWhenWithDeadline (const Condition &cond, absl::Time deadline) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterLockWhenWithDeadline (const Condition &cond, absl::Time deadline) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterLockWhenWithTimeout (const Condition &cond, absl::Duration timeout) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterLockWhenWithTimeout (const Condition &cond, absl::Duration timeout) ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterTryLock () ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
bool WriterTryLock () ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
void WriterUnlock () ABSL_UNLOCK_FUNCTION()
 
void WriterUnlock () ABSL_UNLOCK_FUNCTION()
 
 ~Mutex ()
 
 ~Mutex ()
 

Static Public Member Functions

static void InternalAttemptToUseMutexInFatalSignalHandler ()
 
static void InternalAttemptToUseMutexInFatalSignalHandler ()
 

Private Member Functions

bool AwaitCommon (const Condition &cond, synchronization_internal::KernelTimeout t)
 
bool AwaitCommon (const Condition &cond, synchronization_internal::KernelTimeout t)
 
void Block (base_internal::PerThreadSynch *s)
 
void Block (base_internal::PerThreadSynch *s)
 
void Fer (base_internal::PerThreadSynch *w)
 
void Fer (base_internal::PerThreadSynch *w)
 
void LockSlow (MuHow how, const Condition *cond, int flags) ABSL_ATTRIBUTE_COLD
 
void LockSlow (MuHow how, const Condition *cond, int flags) ABSL_ATTRIBUTE_COLD
 
void LockSlowLoop (SynchWaitParams *waitp, int flags)
 
void LockSlowLoop (SynchWaitParams *waitp, int flags)
 
bool LockSlowWithDeadline (MuHow how, const Condition *cond, synchronization_internal::KernelTimeout t, int flags)
 
bool LockSlowWithDeadline (MuHow how, const Condition *cond, synchronization_internal::KernelTimeout t, int flags)
 
 Mutex (const Mutex &)=delete
 
 Mutex (const Mutex &)=delete
 
 Mutex (const volatile Mutex *)
 
 Mutex (const volatile Mutex *)
 
Mutexoperator= (const Mutex &)=delete
 
Mutexoperator= (const Mutex &)=delete
 
void Trans (MuHow how)
 
void Trans (MuHow how)
 
void TryRemove (base_internal::PerThreadSynch *s)
 
void TryRemove (base_internal::PerThreadSynch *s)
 
void UnlockSlow (SynchWaitParams *waitp) ABSL_ATTRIBUTE_COLD
 
void UnlockSlow (SynchWaitParams *waitp) ABSL_ATTRIBUTE_COLD
 
base_internal::PerThreadSynchWakeup (base_internal::PerThreadSynch *w)
 
base_internal::PerThreadSynchWakeup (base_internal::PerThreadSynch *w)
 

Static Private Member Functions

static bool DecrementSynchSem (Mutex *mu, base_internal::PerThreadSynch *w, synchronization_internal::KernelTimeout t)
 
static bool DecrementSynchSem (Mutex *mu, base_internal::PerThreadSynch *w, synchronization_internal::KernelTimeout t)
 
static void IncrementSynchSem (Mutex *mu, base_internal::PerThreadSynch *w)
 
static void IncrementSynchSem (Mutex *mu, base_internal::PerThreadSynch *w)
 

Private Attributes

std::atomic< intptr_tmu_
 

Friends

class CondVar
 

Detailed Description

Definition at line 131 of file abseil-cpp/absl/synchronization/mutex.h.

Member Typedef Documentation

◆ MuHow [1/2]

typedef const struct MuHowS* absl::Mutex::MuHow

◆ MuHow [2/2]

typedef const struct MuHowS* absl::Mutex::MuHow

Definition at line 445 of file abseil-cpp/absl/synchronization/mutex.h.

Constructor & Destructor Documentation

◆ Mutex() [1/8]

absl::Mutex::Mutex ( )
inline

Definition at line 941 of file abseil-cpp/absl/synchronization/mutex.h.

◆ Mutex() [2/8]

constexpr absl::Mutex::Mutex ( absl::ConstInitType  )
inlineexplicitconstexpr

Definition at line 945 of file abseil-cpp/absl/synchronization/mutex.h.

◆ ~Mutex() [1/2]

absl::Mutex::~Mutex ( )

Definition at line 730 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Mutex() [3/8]

absl::Mutex::Mutex ( const volatile Mutex )
inlineprivate

Definition at line 497 of file abseil-cpp/absl/synchronization/mutex.h.

◆ Mutex() [4/8]

absl::Mutex::Mutex ( const Mutex )
privatedelete

◆ Mutex() [5/8]

absl::Mutex::Mutex ( )

◆ Mutex() [6/8]

constexpr absl::Mutex::Mutex ( absl::ConstInitType  )
explicitconstexpr

◆ ~Mutex() [2/2]

absl::Mutex::~Mutex ( )

◆ Mutex() [7/8]

absl::Mutex::Mutex ( const volatile Mutex )
inlineprivate

◆ Mutex() [8/8]

absl::Mutex::Mutex ( const Mutex )
privatedelete

Member Function Documentation

◆ AssertHeld() [1/2]

void absl::Mutex::AssertHeld ( ) const

◆ AssertHeld() [2/2]

void absl::Mutex::AssertHeld ( ) const

Definition at line 2426 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ AssertNotHeld() [1/2]

void absl::Mutex::AssertNotHeld ( ) const

◆ AssertNotHeld() [2/2]

void absl::Mutex::AssertNotHeld ( ) const

Definition at line 1432 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ AssertReaderHeld() [1/2]

void absl::Mutex::AssertReaderHeld ( ) const

◆ AssertReaderHeld() [2/2]

void absl::Mutex::AssertReaderHeld ( ) const

Definition at line 2435 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Await() [1/2]

void absl::Mutex::Await ( const Condition cond)

◆ Await() [2/2]

void absl::Mutex::Await ( const Condition cond)

Definition at line 1548 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ AwaitCommon() [1/2]

bool absl::Mutex::AwaitCommon ( const Condition cond,
synchronization_internal::KernelTimeout  t 
)
private

◆ AwaitCommon() [2/2]

bool absl::Mutex::AwaitCommon ( const Condition cond,
synchronization_internal::KernelTimeout  t 
)
private

Definition at line 1578 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ AwaitWithDeadline() [1/2]

bool absl::Mutex::AwaitWithDeadline ( const Condition cond,
absl::Time  deadline 
)

◆ AwaitWithDeadline() [2/2]

bool absl::Mutex::AwaitWithDeadline ( const Condition cond,
absl::Time  deadline 
)

Definition at line 1563 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ AwaitWithTimeout() [1/2]

bool absl::Mutex::AwaitWithTimeout ( const Condition cond,
absl::Duration  timeout 
)

◆ AwaitWithTimeout() [2/2]

bool absl::Mutex::AwaitWithTimeout ( const Condition cond,
absl::Duration  timeout 
)

Definition at line 1559 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Block() [1/2]

void absl::Mutex::Block ( base_internal::PerThreadSynch s)
private

◆ Block() [2/2]

void absl::Mutex::Block ( base_internal::PerThreadSynch s)
private

◆ DecrementSynchSem() [1/2]

static bool absl::Mutex::DecrementSynchSem ( Mutex mu,
base_internal::PerThreadSynch w,
synchronization_internal::KernelTimeout  t 
)
staticprivate

◆ DecrementSynchSem() [2/2]

bool absl::Mutex::DecrementSynchSem ( Mutex mu,
base_internal::PerThreadSynch w,
synchronization_internal::KernelTimeout  t 
)
staticprivate

Definition at line 573 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ EnableDebugLog() [1/2]

void absl::Mutex::EnableDebugLog ( const char *  name)

◆ EnableDebugLog() [2/2]

void absl::Mutex::EnableDebugLog ( const char *  name)

Definition at line 741 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ EnableInvariantDebugging() [1/2]

void absl::Mutex::EnableInvariantDebugging ( void(*)(void *)  invariant,
void *  arg 
)

◆ EnableInvariantDebugging() [2/2]

void absl::Mutex::EnableInvariantDebugging ( void(*)(void *)  invariant,
void *  arg 
)

Definition at line 751 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Fer() [1/2]

void absl::Mutex::Fer ( base_internal::PerThreadSynch w)
private

◆ Fer() [2/2]

void absl::Mutex::Fer ( base_internal::PerThreadSynch w)
private

Definition at line 2371 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ ForgetDeadlockInfo() [1/2]

void absl::Mutex::ForgetDeadlockInfo ( )

◆ ForgetDeadlockInfo() [2/2]

void absl::Mutex::ForgetDeadlockInfo ( )

Definition at line 1421 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ IncrementSynchSem() [1/2]

static void absl::Mutex::IncrementSynchSem ( Mutex mu,
base_internal::PerThreadSynch w 
)
staticprivate

◆ IncrementSynchSem() [2/2]

void absl::Mutex::IncrementSynchSem ( Mutex mu,
base_internal::PerThreadSynch w 
)
staticprivate

Definition at line 562 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ InternalAttemptToUseMutexInFatalSignalHandler() [1/2]

static void absl::Mutex::InternalAttemptToUseMutexInFatalSignalHandler ( )
static

◆ InternalAttemptToUseMutexInFatalSignalHandler() [2/2]

void absl::Mutex::InternalAttemptToUseMutexInFatalSignalHandler ( )
static

Definition at line 592 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Lock() [1/2]

void absl::Mutex::Lock ( )

◆ Lock() [2/2]

void absl::Mutex::Lock ( )

◆ LockSlow() [1/2]

void absl::Mutex::LockSlow ( MuHow  how,
const Condition cond,
int  flags 
)
private

◆ LockSlow() [2/2]

ABSL_ATTRIBUTE_NOINLINE void absl::Mutex::LockSlow ( MuHow  how,
const Condition cond,
int  flags 
)
private

Definition at line 1776 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ LockSlowLoop() [1/2]

void absl::Mutex::LockSlowLoop ( SynchWaitParams waitp,
int  flags 
)
private

◆ LockSlowLoop() [2/2]

void absl::Mutex::LockSlowLoop ( SynchWaitParams waitp,
int  flags 
)
private

Definition at line 1926 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ LockSlowWithDeadline() [1/2]

bool absl::Mutex::LockSlowWithDeadline ( MuHow  how,
const Condition cond,
synchronization_internal::KernelTimeout  t,
int  flags 
)
private

◆ LockSlowWithDeadline() [2/2]

bool absl::Mutex::LockSlowWithDeadline ( MuHow  how,
const Condition cond,
synchronization_internal::KernelTimeout  t,
int  flags 
)
private

Definition at line 1859 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ LockWhen() [1/2]

void absl::Mutex::LockWhen ( const Condition cond)

◆ LockWhen() [2/2]

void absl::Mutex::LockWhen ( const Condition cond)

Definition at line 1503 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ LockWhenWithDeadline() [1/2]

bool absl::Mutex::LockWhenWithDeadline ( const Condition cond,
absl::Time  deadline 
)

◆ LockWhenWithDeadline() [2/2]

bool absl::Mutex::LockWhenWithDeadline ( const Condition cond,
absl::Time  deadline 
)

Definition at line 1515 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ LockWhenWithTimeout() [1/2]

bool absl::Mutex::LockWhenWithTimeout ( const Condition cond,
absl::Duration  timeout 
)

◆ LockWhenWithTimeout() [2/2]

bool absl::Mutex::LockWhenWithTimeout ( const Condition cond,
absl::Duration  timeout 
)

Definition at line 1511 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ operator=() [1/2]

Mutex& absl::Mutex::operator= ( const Mutex )
privatedelete

◆ operator=() [2/2]

Mutex& absl::Mutex::operator= ( const Mutex )
privatedelete

◆ ReaderLock() [1/2]

void absl::Mutex::ReaderLock ( )

◆ ReaderLock() [2/2]

void absl::Mutex::ReaderLock ( )

◆ ReaderLockWhen() [1/2]

void absl::Mutex::ReaderLockWhen ( const Condition cond)

◆ ReaderLockWhen() [2/2]

void absl::Mutex::ReaderLockWhen ( const Condition cond)

Definition at line 1525 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ ReaderLockWhenWithDeadline() [1/2]

bool absl::Mutex::ReaderLockWhenWithDeadline ( const Condition cond,
absl::Time  deadline 
)

◆ ReaderLockWhenWithDeadline() [2/2]

bool absl::Mutex::ReaderLockWhenWithDeadline ( const Condition cond,
absl::Time  deadline 
)

Definition at line 1538 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ ReaderLockWhenWithTimeout() [1/2]

bool absl::Mutex::ReaderLockWhenWithTimeout ( const Condition cond,
absl::Duration  timeout 
)

◆ ReaderLockWhenWithTimeout() [2/2]

bool absl::Mutex::ReaderLockWhenWithTimeout ( const Condition cond,
absl::Duration  timeout 
)

Definition at line 1533 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ ReaderTryLock() [1/2]

bool absl::Mutex::ReaderTryLock ( )

◆ ReaderTryLock() [2/2]

bool absl::Mutex::ReaderTryLock ( )

◆ ReaderUnlock() [1/2]

void absl::Mutex::ReaderUnlock ( )

◆ ReaderUnlock() [2/2]

void absl::Mutex::ReaderUnlock ( )

◆ Trans() [1/2]

void absl::Mutex::Trans ( MuHow  how)
private

◆ Trans() [2/2]

void absl::Mutex::Trans ( MuHow  how)
private

Definition at line 2363 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ TryLock() [1/2]

bool absl::Mutex::TryLock ( )

◆ TryLock() [2/2]

bool absl::Mutex::TryLock ( )

◆ TryRemove() [1/2]

void absl::Mutex::TryRemove ( base_internal::PerThreadSynch s)
private

◆ TryRemove() [2/2]

void absl::Mutex::TryRemove ( base_internal::PerThreadSynch s)
private

Definition at line 1066 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Unlock() [1/2]

void absl::Mutex::Unlock ( )

◆ Unlock() [2/2]

void absl::Mutex::Unlock ( )

◆ UnlockSlow() [1/2]

void absl::Mutex::UnlockSlow ( SynchWaitParams waitp)
private

◆ UnlockSlow() [2/2]

ABSL_ATTRIBUTE_NOINLINE void absl::Mutex::UnlockSlow ( SynchWaitParams waitp)
private

Definition at line 2051 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ Wakeup() [1/2]

base_internal::PerThreadSynch* absl::Mutex::Wakeup ( base_internal::PerThreadSynch w)
private

◆ Wakeup() [2/2]

PerThreadSynch * absl::Mutex::Wakeup ( base_internal::PerThreadSynch w)
private

Definition at line 1152 of file abseil-cpp/absl/synchronization/mutex.cc.

◆ WriterLock() [1/2]

void absl::Mutex::WriterLock ( )
inline

◆ WriterLock() [2/2]

void absl::Mutex::WriterLock ( )
inline

Definition at line 260 of file abseil-cpp/absl/synchronization/mutex.h.

◆ WriterLockWhen() [1/2]

void absl::Mutex::WriterLockWhen ( const Condition cond)
inline

◆ WriterLockWhen() [2/2]

void absl::Mutex::WriterLockWhen ( const Condition cond)
inline

Definition at line 322 of file abseil-cpp/absl/synchronization/mutex.h.

◆ WriterLockWhenWithDeadline() [1/2]

bool absl::Mutex::WriterLockWhenWithDeadline ( const Condition cond,
absl::Time  deadline 
)
inline

◆ WriterLockWhenWithDeadline() [2/2]

bool absl::Mutex::WriterLockWhenWithDeadline ( const Condition cond,
absl::Time  deadline 
)
inline

Definition at line 386 of file abseil-cpp/absl/synchronization/mutex.h.

◆ WriterLockWhenWithTimeout() [1/2]

bool absl::Mutex::WriterLockWhenWithTimeout ( const Condition cond,
absl::Duration  timeout 
)
inline

◆ WriterLockWhenWithTimeout() [2/2]

bool absl::Mutex::WriterLockWhenWithTimeout ( const Condition cond,
absl::Duration  timeout 
)
inline

Definition at line 366 of file abseil-cpp/absl/synchronization/mutex.h.

◆ WriterTryLock() [1/2]

bool absl::Mutex::WriterTryLock ( )
inline

◆ WriterTryLock() [2/2]

bool absl::Mutex::WriterTryLock ( )
inline

Definition at line 264 of file abseil-cpp/absl/synchronization/mutex.h.

◆ WriterUnlock() [1/2]

void absl::Mutex::WriterUnlock ( )
inline

◆ WriterUnlock() [2/2]

void absl::Mutex::WriterUnlock ( )
inline

Definition at line 262 of file abseil-cpp/absl/synchronization/mutex.h.

Friends And Related Function Documentation

◆ CondVar

CondVar
friend

Definition at line 491 of file abseil-cpp/absl/synchronization/mutex.h.

Member Data Documentation

◆ mu_

std::atomic< intptr_t > absl::Mutex::mu_
private

Definition at line 463 of file abseil-cpp/absl/synchronization/mutex.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:02:18