#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 &) |
void | SlowLock () ABSL_ATTRIBUTE_COLD |
void | SlowUnlock (uint32_t lock_value) ABSL_ATTRIBUTE_COLD |
SpinLock (const SpinLock &) | |
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.
anonymous enum [private] |
Definition at line 151 of file spinlock.h.
anonymous enum [private] |
Definition at line 152 of file spinlock.h.
anonymous enum [private] |
Definition at line 153 of file spinlock.h.
anonymous enum [private] |
Definition at line 154 of file spinlock.h.
anonymous enum [private] |
Definition at line 150 of file spinlock.h.
absl::base_internal::SpinLock::SpinLock | ( | ) | [inline] |
Definition at line 53 of file spinlock.h.
absl::base_internal::SpinLock::SpinLock | ( | base_internal::LinkerInitialized | ) | [inline, explicit] |
Definition at line 68 of file spinlock.h.
absl::base_internal::SpinLock::SpinLock | ( | base_internal::SchedulingMode | mode | ) | [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.
absl::base_internal::SpinLock::~SpinLock | ( | ) | [inline] |
Definition at line 79 of file spinlock.h.
absl::base_internal::SpinLock::SpinLock | ( | const SpinLock & | ) | [private] |
uint64_t absl::base_internal::SpinLock::DecodeWaitCycles | ( | uint32_t | lock_value | ) | [static, protected] |
Definition at line 222 of file spinlock.cc.
uint32_t absl::base_internal::SpinLock::EncodeWaitCycles | ( | int64_t | wait_start_time, |
int64_t | wait_end_time | ||
) | [static, protected] |
Definition at line 198 of file spinlock.cc.
void absl::base_internal::SpinLock::InitLinkerInitializedAndCooperative | ( | ) | [private] |
Definition at line 91 of file spinlock.cc.
static constexpr bool absl::base_internal::SpinLock::IsCooperative | ( | base_internal::SchedulingMode | scheduling_mode | ) | [inline, static, private] |
Definition at line 158 of file spinlock.h.
bool absl::base_internal::SpinLock::IsHeld | ( | ) | const [inline] |
Definition at line 125 of file spinlock.h.
void absl::base_internal::SpinLock::Lock | ( | ) | [inline] |
Definition at line 82 of file spinlock.h.
void absl::base_internal::SpinLock::SlowLock | ( | ) | [private] |
Definition at line 117 of file spinlock.cc.
void absl::base_internal::SpinLock::SlowUnlock | ( | uint32_t | lock_value | ) | [private] |
Definition at line 174 of file spinlock.cc.
uint32_t absl::base_internal::SpinLock::SpinLoop | ( | ) | [private] |
Definition at line 100 of file spinlock.cc.
bool absl::base_internal::SpinLock::TryLock | ( | ) | [inline] |
Definition at line 94 of file spinlock.h.
bool absl::base_internal::SpinLock::TryLockImpl | ( | ) | [inline, private] |
Definition at line 169 of file spinlock.h.
uint32_t absl::base_internal::SpinLock::TryLockInternal | ( | uint32_t | lock_value, |
uint32_t | wait_cycles | ||
) | [inline, private] |
Definition at line 213 of file spinlock.h.
void absl::base_internal::SpinLock::Unlock | ( | ) | [inline] |
Definition at line 104 of file spinlock.h.
friend struct SpinLockTest [friend] |
Definition at line 141 of file spinlock.h.
std::atomic<uint32_t> absl::base_internal::SpinLock::lockword_ [private] |
Definition at line 174 of file spinlock.h.