#include <spinlock.h>
Public Member Functions | |
bool | IsHeld () const |
void | Lock () EXCLUSIVE_LOCK_FUNCTION() |
SpinLock () | |
SpinLock (base_internal::LinkerInitialized) | |
SpinLock (base_internal::SchedulingMode mode) | |
SpinLock (base_internal::LinkerInitialized, base_internal::SchedulingMode mode) | |
bool | TryLock () EXCLUSIVE_TRYLOCK_FUNCTION(true) |
void | Unlock () UNLOCK_FUNCTION() |
~SpinLock () | |
Static Protected Member Functions | |
static uint64_t | DecodeWaitCycles (uint32_t lock_value) |
static uint32_t | EncodeWaitCycles (int64_t wait_start_time, int64_t wait_end_time) |
Private Types | |
enum | { kSpinLockCooperative = 2 } |
enum | { kSpinLockDisabledScheduling = 4 } |
enum | { kSpinLockSleeper = 8 } |
enum | { kWaitTimeMask } |
enum | { kSpinLockHeld = 1 } |
Private Member Functions | |
void | InitLinkerInitializedAndCooperative () |
SpinLock & | operator= (const SpinLock &)=delete |
void | SlowLock () ABSL_ATTRIBUTE_COLD |
void | SlowUnlock (uint32_t lock_value) ABSL_ATTRIBUTE_COLD |
SpinLock (const SpinLock &)=delete | |
uint32_t | SpinLoop () |
bool | TryLockImpl () |
uint32_t | TryLockInternal (uint32_t lock_value, uint32_t wait_cycles) |
Static Private Member Functions | |
static constexpr bool | IsCooperative (base_internal::SchedulingMode scheduling_mode) |
Private Attributes | |
std::atomic< uint32_t > | lockword_ |
Friends | |
struct | SpinLockTest |
Definition at line 51 of file spinlock.h.
|
private |
Enumerator | |
---|---|
kSpinLockCooperative |
Definition at line 151 of file spinlock.h.
|
private |
Enumerator | |
---|---|
kSpinLockDisabledScheduling |
Definition at line 152 of file spinlock.h.
|
private |
Enumerator | |
---|---|
kSpinLockSleeper |
Definition at line 153 of file spinlock.h.
|
private |
Enumerator | |
---|---|
kWaitTimeMask |
Definition at line 154 of file spinlock.h.
|
private |
Enumerator | |
---|---|
kSpinLockHeld |
Definition at line 150 of file spinlock.h.
|
inline |
Definition at line 53 of file spinlock.h.
|
inlineexplicit |
Definition at line 68 of file spinlock.h.
|
explicit |
Definition at line 69 of file spinlock.cc.
absl::base_internal::SpinLock::SpinLock | ( | base_internal::LinkerInitialized | , |
base_internal::SchedulingMode | mode | ||
) |
Definition at line 74 of file spinlock.cc.
|
inline |
Definition at line 79 of file spinlock.h.
|
privatedelete |
|
staticprotected |
Definition at line 222 of file spinlock.cc.
|
staticprotected |
Definition at line 198 of file spinlock.cc.
|
private |
Definition at line 91 of file spinlock.cc.
|
inlinestaticprivate |
Definition at line 158 of file spinlock.h.
|
inline |
Definition at line 125 of file spinlock.h.
|
inline |
Definition at line 82 of file spinlock.h.
|
private |
Definition at line 117 of file spinlock.cc.
|
private |
Definition at line 174 of file spinlock.cc.
|
private |
Definition at line 100 of file spinlock.cc.
|
inline |
Definition at line 94 of file spinlock.h.
|
inlineprivate |
Definition at line 169 of file spinlock.h.
|
inlineprivate |
Definition at line 213 of file spinlock.h.
|
inline |
Definition at line 104 of file spinlock.h.
|
friend |
Definition at line 141 of file spinlock.h.
|
private |
Definition at line 174 of file spinlock.h.