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
 

Public Member Functions

void AssertHeld () const ASSERT_EXCLUSIVE_LOCK()
 
void AssertNotHeld () const
 
void AssertReaderHeld () const ASSERT_SHARED_LOCK()
 
void Await (const Condition &cond)
 
bool AwaitWithDeadline (const Condition &cond, absl::Time deadline)
 
bool AwaitWithTimeout (const Condition &cond, absl::Duration timeout)
 
void EnableDebugLog (const char *name)
 
void EnableInvariantDebugging (void(*invariant)(void *), void *arg)
 
void ForgetDeadlockInfo ()
 
void Lock () EXCLUSIVE_LOCK_FUNCTION()
 
void LockWhen (const Condition &cond) EXCLUSIVE_LOCK_FUNCTION()
 
bool LockWhenWithDeadline (const Condition &cond, absl::Time deadline) EXCLUSIVE_LOCK_FUNCTION()
 
bool LockWhenWithTimeout (const Condition &cond, absl::Duration timeout) EXCLUSIVE_LOCK_FUNCTION()
 
 Mutex ()
 
constexpr Mutex (absl::ConstInitType)
 
void ReaderLock () SHARED_LOCK_FUNCTION()
 
void ReaderLockWhen (const Condition &cond) SHARED_LOCK_FUNCTION()
 
bool ReaderLockWhenWithDeadline (const Condition &cond, absl::Time deadline) SHARED_LOCK_FUNCTION()
 
bool ReaderLockWhenWithTimeout (const Condition &cond, absl::Duration timeout) SHARED_LOCK_FUNCTION()
 
bool ReaderTryLock () SHARED_TRYLOCK_FUNCTION(true)
 
void ReaderUnlock () UNLOCK_FUNCTION()
 
bool TryLock () EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
void Unlock () UNLOCK_FUNCTION()
 
void WriterLock () EXCLUSIVE_LOCK_FUNCTION()
 
void WriterLockWhen (const Condition &cond) EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterLockWhenWithDeadline (const Condition &cond, absl::Time deadline) EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterLockWhenWithTimeout (const Condition &cond, absl::Duration timeout) EXCLUSIVE_LOCK_FUNCTION()
 
bool WriterTryLock () EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
void WriterUnlock () UNLOCK_FUNCTION()
 
 ~Mutex ()
 

Static Public Member Functions

static void InternalAttemptToUseMutexInFatalSignalHandler ()
 

Private Member Functions

bool AwaitCommon (const Condition &cond, synchronization_internal::KernelTimeout t)
 
void Block (base_internal::PerThreadSynch *s)
 
void Fer (base_internal::PerThreadSynch *w)
 
void LockSlow (MuHow how, const Condition *cond, int flags) ABSL_ATTRIBUTE_COLD
 
void LockSlowLoop (SynchWaitParams *waitp, int flags)
 
bool LockSlowWithDeadline (MuHow how, const Condition *cond, synchronization_internal::KernelTimeout t, int flags)
 
 Mutex (const volatile Mutex *)
 
 Mutex (const Mutex &)=delete
 
Mutexoperator= (const Mutex &)=delete
 
void Trans (MuHow how)
 
void TryRemove (base_internal::PerThreadSynch *s)
 
void UnlockSlow (SynchWaitParams *waitp) ABSL_ATTRIBUTE_COLD
 
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 void IncrementSynchSem (Mutex *mu, base_internal::PerThreadSynch *w)
 

Private Attributes

std::atomic< intptr_t > mu_
 

Friends

class CondVar
 

Detailed Description

Definition at line 138 of file mutex.h.

Member Typedef Documentation

◆ MuHow

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

Definition at line 446 of file mutex.h.

Constructor & Destructor Documentation

◆ Mutex() [1/4]

absl::Mutex::Mutex ( )
inline

Definition at line 193 of file mutex_nonprod.cc.

◆ Mutex() [2/4]

constexpr absl::Mutex::Mutex ( absl::ConstInitType  )
inlineexplicit

Definition at line 910 of file mutex.h.

◆ ~Mutex()

absl::Mutex::~Mutex ( )

Definition at line 195 of file mutex_nonprod.cc.

◆ Mutex() [3/4]

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

Definition at line 510 of file mutex.h.

◆ Mutex() [4/4]

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

Member Function Documentation

◆ AssertHeld()

void absl::Mutex::AssertHeld ( ) const

Definition at line 251 of file mutex_nonprod.cc.

◆ AssertNotHeld()

void absl::Mutex::AssertNotHeld ( ) const

Definition at line 253 of file mutex_nonprod.cc.

◆ AssertReaderHeld()

void absl::Mutex::AssertReaderHeld ( ) const

Definition at line 252 of file mutex_nonprod.cc.

◆ Await()

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

Definition at line 207 of file mutex_nonprod.cc.

◆ AwaitCommon()

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

Definition at line 1562 of file mutex.cc.

◆ AwaitWithDeadline()

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

Definition at line 214 of file mutex_nonprod.cc.

◆ AwaitWithTimeout()

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

Definition at line 219 of file mutex_nonprod.cc.

◆ Block()

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

◆ DecrementSynchSem()

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

Definition at line 556 of file mutex.cc.

◆ EnableDebugLog()

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

Definition at line 248 of file mutex_nonprod.cc.

◆ EnableInvariantDebugging()

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

Definition at line 249 of file mutex_nonprod.cc.

◆ Fer()

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

Definition at line 2331 of file mutex.cc.

◆ ForgetDeadlockInfo()

void absl::Mutex::ForgetDeadlockInfo ( )

Definition at line 250 of file mutex_nonprod.cc.

◆ IncrementSynchSem()

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

Definition at line 545 of file mutex.cc.

◆ InternalAttemptToUseMutexInFatalSignalHandler()

void absl::Mutex::InternalAttemptToUseMutexInFatalSignalHandler ( )
static

Definition at line 575 of file mutex.cc.

◆ Lock()

void absl::Mutex::Lock ( )

Definition at line 197 of file mutex_nonprod.cc.

◆ LockSlow()

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

Definition at line 1750 of file mutex.cc.

◆ LockSlowLoop()

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

Definition at line 1897 of file mutex.cc.

◆ LockSlowWithDeadline()

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

Definition at line 1832 of file mutex.cc.

◆ LockWhen()

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

Definition at line 209 of file mutex_nonprod.cc.

◆ LockWhenWithDeadline()

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

Definition at line 224 of file mutex_nonprod.cc.

◆ LockWhenWithTimeout()

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

Definition at line 229 of file mutex_nonprod.cc.

◆ operator=()

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

◆ ReaderLock()

void absl::Mutex::ReaderLock ( )

Definition at line 203 of file mutex_nonprod.cc.

◆ ReaderLockWhen()

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

Definition at line 234 of file mutex_nonprod.cc.

◆ ReaderLockWhenWithDeadline()

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

Definition at line 243 of file mutex_nonprod.cc.

◆ ReaderLockWhenWithTimeout()

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

Definition at line 239 of file mutex_nonprod.cc.

◆ ReaderTryLock()

bool absl::Mutex::ReaderTryLock ( )

◆ ReaderUnlock()

void absl::Mutex::ReaderUnlock ( )

Definition at line 205 of file mutex_nonprod.cc.

◆ Trans()

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

Definition at line 2323 of file mutex.cc.

◆ TryLock()

bool absl::Mutex::TryLock ( )

Definition at line 201 of file mutex_nonprod.cc.

◆ TryRemove()

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

Definition at line 1053 of file mutex.cc.

◆ Unlock()

void absl::Mutex::Unlock ( )

Definition at line 199 of file mutex_nonprod.cc.

◆ UnlockSlow()

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

Definition at line 2016 of file mutex.cc.

◆ Wakeup()

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

Definition at line 1136 of file mutex.cc.

◆ WriterLock()

void absl::Mutex::WriterLock ( )
inline

Definition at line 260 of file mutex.h.

◆ WriterLockWhen()

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

Definition at line 322 of file mutex.h.

◆ WriterLockWhenWithDeadline()

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

Definition at line 387 of file mutex.h.

◆ WriterLockWhenWithTimeout()

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

Definition at line 367 of file mutex.h.

◆ WriterTryLock()

bool absl::Mutex::WriterTryLock ( )
inline

Definition at line 264 of file mutex.h.

◆ WriterUnlock()

void absl::Mutex::WriterUnlock ( )
inline

Definition at line 262 of file mutex.h.

Friends And Related Function Documentation

◆ CondVar

friend class CondVar
friend

Definition at line 503 of file mutex.h.

Member Data Documentation

◆ mu_

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

Definition at line 473 of file mutex.h.


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


abseil_cpp
Author(s):
autogenerated on Mon Feb 28 2022 21:31:22