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

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

Definition at line 446 of file mutex.h.

Constructor & Destructor Documentation

absl::Mutex::Mutex ( )
inline

Definition at line 193 of file mutex_nonprod.cc.

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

Definition at line 910 of file mutex.h.

absl::Mutex::~Mutex ( )

Definition at line 195 of file mutex_nonprod.cc.

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

Definition at line 510 of file mutex.h.

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

Member Function Documentation

void absl::Mutex::AssertHeld ( ) const

Definition at line 251 of file mutex_nonprod.cc.

void absl::Mutex::AssertNotHeld ( ) const

Definition at line 253 of file mutex_nonprod.cc.

void absl::Mutex::AssertReaderHeld ( ) const

Definition at line 252 of file mutex_nonprod.cc.

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

Definition at line 207 of file mutex_nonprod.cc.

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

Definition at line 1562 of file mutex.cc.

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

Definition at line 214 of file mutex_nonprod.cc.

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

Definition at line 219 of file mutex_nonprod.cc.

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

Definition at line 556 of file mutex.cc.

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

Definition at line 248 of file mutex_nonprod.cc.

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

Definition at line 249 of file mutex_nonprod.cc.

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

Definition at line 2331 of file mutex.cc.

void absl::Mutex::ForgetDeadlockInfo ( )

Definition at line 250 of file mutex_nonprod.cc.

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

Definition at line 545 of file mutex.cc.

void absl::Mutex::InternalAttemptToUseMutexInFatalSignalHandler ( )
static

Definition at line 575 of file mutex.cc.

void absl::Mutex::Lock ( )

Definition at line 197 of file mutex_nonprod.cc.

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

Definition at line 1750 of file mutex.cc.

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

Definition at line 1897 of file mutex.cc.

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

Definition at line 1832 of file mutex.cc.

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

Definition at line 209 of file mutex_nonprod.cc.

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

Definition at line 224 of file mutex_nonprod.cc.

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

Definition at line 229 of file mutex_nonprod.cc.

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

Definition at line 203 of file mutex_nonprod.cc.

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

Definition at line 234 of file mutex_nonprod.cc.

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

Definition at line 243 of file mutex_nonprod.cc.

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

Definition at line 239 of file mutex_nonprod.cc.

bool absl::Mutex::ReaderTryLock ( )
void absl::Mutex::ReaderUnlock ( )

Definition at line 205 of file mutex_nonprod.cc.

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

Definition at line 2323 of file mutex.cc.

bool absl::Mutex::TryLock ( )

Definition at line 201 of file mutex_nonprod.cc.

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

Definition at line 1053 of file mutex.cc.

void absl::Mutex::Unlock ( )

Definition at line 199 of file mutex_nonprod.cc.

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

Definition at line 2016 of file mutex.cc.

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

Definition at line 1136 of file mutex.cc.

void absl::Mutex::WriterLock ( )
inline

Definition at line 260 of file mutex.h.

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

Definition at line 322 of file mutex.h.

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

Definition at line 387 of file mutex.h.

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

Definition at line 367 of file mutex.h.

bool absl::Mutex::WriterTryLock ( )
inline

Definition at line 264 of file mutex.h.

void absl::Mutex::WriterUnlock ( )
inline

Definition at line 262 of file mutex.h.

Friends And Related Function Documentation

friend class CondVar
friend

Definition at line 503 of file mutex.h.

Member Data Documentation

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 Tue Jun 18 2019 19:44:38