#include "absl/synchronization/mutex.h"
#include <fcntl.h>
#include <pthread.h>
#include <sched.h>
#include <sys/time.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <algorithm>
#include <atomic>
#include <cinttypes>
#include <thread>
#include "absl/base/attributes.h"
#include "absl/base/config.h"
#include "absl/base/dynamic_annotations.h"
#include "absl/base/internal/atomic_hook.h"
#include "absl/base/internal/cycleclock.h"
#include "absl/base/internal/hide_ptr.h"
#include "absl/base/internal/low_level_alloc.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/internal/spinlock.h"
#include "absl/base/internal/sysinfo.h"
#include "absl/base/internal/thread_identity.h"
#include "absl/base/port.h"
#include "absl/debugging/stacktrace.h"
#include "absl/debugging/symbolize.h"
#include "absl/synchronization/internal/graphcycles.h"
#include "absl/synchronization/internal/per_thread_sem.h"
Go to the source code of this file.
Classes | |
struct | absl::MuHowS |
struct | absl::SynchEvent |
struct | absl::SynchLocksHeld |
struct | absl::SynchWaitParams |
Namespaces | |
namespace | absl |
Defines | |
#define | __tsan_read1(addr) |
#define | RAW_CHECK_FMT(cond,...) |
Enumerations | |
enum | { absl::kGdbMuSpin = kMuSpin, absl::kGdbMuEvent = kMuEvent, absl::kGdbMuWait = kMuWait, absl::kGdbMuWriter = kMuWriter, absl::kGdbMuDesig = kMuDesig, absl::kGdbMuWrWait = kMuWrWait, absl::kGdbMuReader = kMuReader, absl::kGdbMuLow = kMuLow } |
enum | { absl::kGdbCvSpin = kCvSpin, absl::kGdbCvEvent = kCvEvent, absl::kGdbCvLow = kCvLow } |
enum | |
enum | |
enum | |
enum | DelayMode |
Functions | |
absl::ABSL_XRAY_LOG_ARGS (1) void Mutex | |
ABSL_ATTRIBUTE_WEAK void | AbslInternalMutexYield () |
static void | absl::AtomicClearBits (std::atomic< intptr_t > *pv, intptr_t bits, intptr_t wait_until_clear) |
static void | absl::AtomicSetBits (std::atomic< intptr_t > *pv, intptr_t bits, intptr_t wait_until_clear) |
static void | absl::CheckForMutexCorruption (intptr_t v, const char *label) |
static void | absl::CondVarEnqueue (SynchWaitParams *waitp) |
static char * | absl::CurrentStackString (char *buf, int maxlen, bool symbolize) |
static absl::Time | absl::DeadlineFromTimeout (absl::Duration timeout) |
static GraphId | absl::DeadlockCheck (Mutex *mu) |
static GraphId | absl::DebugOnlyDeadlockCheck (Mutex *mu) |
static bool | absl::DebugOnlyIsExiting () |
static void | absl::DebugOnlyLockEnter (Mutex *mu) |
static void | absl::DebugOnlyLockEnter (Mutex *mu, GraphId id) |
static void | absl::DebugOnlyLockLeave (Mutex *mu) |
static int | absl::Delay (int32_t c, DelayMode mode) |
static void | absl::DeleteSynchEvent (SynchEvent *e) |
static PerThreadSynch * | absl::Dequeue (PerThreadSynch *head, PerThreadSynch *pw) |
static PerThreadSynch * | absl::DequeueAllWakeable (PerThreadSynch *head, PerThreadSynch *pw, PerThreadSynch **wake_tail) |
static bool | absl::Dereference (void *arg) |
void | absl::EnableMutexInvariantDebugging (bool enabled) |
static PerThreadSynch * | absl::Enqueue (PerThreadSynch *head, SynchWaitParams *waitp, intptr_t mu, int flags) |
static SynchEvent * | absl::EnsureSynchEvent (std::atomic< intptr_t > *addr, const char *name, intptr_t bits, intptr_t lockbit) |
static bool | absl::EvalConditionAnnotated (const Condition *cond, Mutex *mu, bool locking, bool trylock, bool read_lock) |
static bool | absl::EvalConditionIgnored (Mutex *mu, const Condition *cond) |
static bool | absl::ExactlyOneReader (intptr_t v) |
static void | absl::FixSkip (PerThreadSynch *ancestor, PerThreadSynch *to_be_removed) |
static void | absl::ForgetSynchEvent (std::atomic< intptr_t > *addr, intptr_t bits, intptr_t lockbit) |
static GraphId | absl::GetGraphId (Mutex *mu) LOCKS_EXCLUDED(deadlock_graph_mu) |
static GraphId | absl::GetGraphIdLocked (Mutex *mu) EXCLUSIVE_LOCKS_REQUIRED(deadlock_graph_mu) |
static PerThreadSynch * | absl::GetPerThreadSynch (intptr_t v) |
static SynchEvent * | absl::GetSynchEvent (const void *addr) |
static GraphCycles *deadlock_graph | absl::GUARDED_BY (deadlock_graph_mu) PT_GUARDED_BY(deadlock_graph_mu) |
static struct absl::SynchEvent | absl::GUARDED_BY (synch_event_mu) |
int refcount | GUARDED_BY (synch_event_mu) |
static void | absl::LockEnter (Mutex *mu, GraphId id, SynchLocksHeld *held_locks) |
static void | absl::LockLeave (Mutex *mu, GraphId id, SynchLocksHeld *held_locks) |
static SynchLocksHeld * | absl::LocksHeldAlloc () |
static bool | absl::MuSameCondition (PerThreadSynch *x, PerThreadSynch *y) |
static void | absl::PostSynchEvent (void *obj, int ev) |
void | absl::RegisterCondVarTracer (void(*fn)(const char *msg, const void *cv)) |
void | absl::RegisterMutexProfiler (void(*fn)(int64_t wait_timestamp)) |
void | absl::RegisterMutexTracer (void(*fn)(const char *msg, const void *obj, int64_t wait_cycles)) |
void | absl::RegisterSymbolizer (bool(*fn)(const void *pc, char *out, int out_size)) |
void | absl::SetMutexDeadlockDetectionMode (OnDeadlockCycle mode) |
static PerThreadSynch * | absl::Skip (PerThreadSynch *x) |
static char * | absl::StackString (void **pcs, int n, char *buf, int maxlen, bool symbolize) |
absl::static_assert (PerThreadSynch::kAlignment > kMuLow,"PerThreadSynch::kAlignment must be greater than kMuLow") | |
absl::static_assert (PerThreadSynch::kAlignment > kCvLow,"PerThreadSynch::kAlignment must be greater than kCvLow") | |
static SynchLocksHeld * | absl::Synch_GetAllLocks () |
static PerThreadSynch * | absl::Synch_GetPerThread () |
static PerThreadSynch * | absl::Synch_GetPerThreadAnnotated (Mutex *mu) |
static bool | absl::TryAcquireWithSpinning (std::atomic< intptr_t > *mu) |
static void | absl::UnrefSynchEvent (SynchEvent *e) |
Variables | |
void * | arg |
static absl::base_internal::SpinLock | absl::deadlock_graph_mu (absl::base_internal::kLinkerInitialized) |
struct { | |
int absl::flags | |
const char * absl::msg | |
} | absl::event_properties [] |
struct absl::SynchWaitParams | absl::GUARDED_BY [kNSynchEvent] |
static const intptr_t | absl::ignore_waiting_writers [] |
void(* | invariant )(void *arg) |
static const intptr_t | absl::kCvEvent = 0x0002L |
static const intptr_t | absl::kCvLow = 0x0003L |
static const intptr_t | absl::kCvSpin = 0x0001L |
static constexpr bool | absl::kDebugMode = true |
static const Mutex::MuHow | absl::kExclusive = &kExclusiveS |
static const MuHowS | absl::kExclusiveS |
static const intptr_t | absl::kMuDesig = 0x0002L |
static const intptr_t | absl::kMuEvent = 0x0010L |
static const int | absl::kMuHasBlocked = 0x01 |
static const intptr_t | absl::kMuHigh = ~kMuLow |
static const int | absl::kMuIsCond = 0x02 |
static const intptr_t | absl::kMuLow = 0x00ffL |
static const intptr_t | absl::kMuOne = 0x0100 |
static const intptr_t | absl::kMuReader = 0x0001L |
static const intptr_t | absl::kMuSpin = 0x0040L |
static const intptr_t | absl::kMuWait = 0x0004L |
static const intptr_t | absl::kMuWriter = 0x0008L |
static const intptr_t | absl::kMuWrWait = 0x0020L |
static const uint32_t | absl::kNSynchEvent = 1031 |
static PerThreadSynch *const | absl::kPerThreadSynchNull |
static const Mutex::MuHow | absl::kShared = &kSharedS |
static const MuHowS | absl::kSharedS |
bool | log |
uintptr_t | masked_addr |
char | name [1] |
static absl::base_internal::SpinLock | absl::synch_event_mu (absl::base_internal::kLinkerInitialized) |
static const intptr_t | absl::zap_desig_waker [] |
#define __tsan_read1 | ( | addr | ) |
#define RAW_CHECK_FMT | ( | cond, | |
... | |||
) |
do { \ if (ABSL_PREDICT_FALSE(!(cond))) { \ ABSL_RAW_LOG(FATAL, "Check " #cond " failed: " __VA_ARGS__); \ } \ } while (0)
SynchEvent *next GUARDED_BY | ( | synch_event_mu | ) |
uintptr_t masked_addr |
char padding[ABSL_CACHELINE_SIZE-2 *sizeof(int)] |