struct PerThreadSynch

Defined at line 49 of file ../../third_party/abseil-cpp/absl/base/internal/thread_identity.h

Used by the implementation of absl::Mutex and absl::CondVar.

Public Members

bool may_skip
bool wake
bool cond_waiter
bool maybe_unlocking
bool suppress_fatal_errors
int priority
atomic state
SynchWaitParams * waitp
intptr_t readers
int64_t next_priority_read_cycles
SynchLocksHeld * all_locks
static const int kLowZeroBits
static const int kAlignment

Public Methods

ThreadIdentity * thread_identity ()

Returns the associated ThreadIdentity.

This can be implemented as a cast because we guarantee

PerThreadSynch is the first element of ThreadIdentity.

Defined at line 61 of file ../../third_party/abseil-cpp/absl/base/internal/thread_identity.h

Enumerations

enum State
Name Value
kAvailable 0
kQueued 1

State values:

kAvailable: This PerThreadSynch is available.

kQueued: This PerThreadSynch is unavailable, it's currently queued on a

Mutex or CondVar waistlist.

Transitions from kQueued to kAvailable require a release

barrier. This is needed as a waiter may use "state" to

independently observe that it's no longer queued.

Transitions from kAvailable to kQueued require no barrier, they

are externally ordered by the Mutex.

Defined at line 107 of file ../../third_party/abseil-cpp/absl/base/internal/thread_identity.h