Public Member Functions | Static Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
absl::base_internal::SpinLock Class Reference

#include <spinlock.h>

List of all members.

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 ()
SpinLockoperator= (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

Detailed Description

Definition at line 51 of file spinlock.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
kSpinLockCooperative 

Definition at line 151 of file spinlock.h.

anonymous enum [private]
Enumerator:
kSpinLockDisabledScheduling 

Definition at line 152 of file spinlock.h.

anonymous enum [private]
Enumerator:
kSpinLockSleeper 

Definition at line 153 of file spinlock.h.

anonymous enum [private]
Enumerator:
kWaitTimeMask 

Definition at line 154 of file spinlock.h.

anonymous enum [private]
Enumerator:
kSpinLockHeld 

Definition at line 150 of file spinlock.h.


Constructor & Destructor Documentation

Definition at line 53 of file spinlock.h.

Definition at line 68 of file spinlock.h.

Definition at line 69 of file spinlock.cc.

Definition at line 74 of file spinlock.cc.

Definition at line 79 of file spinlock.h.


Member Function Documentation

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.

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.

Definition at line 82 of file spinlock.h.

SpinLock& absl::base_internal::SpinLock::operator= ( const SpinLock ) [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.

Definition at line 100 of file spinlock.cc.

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.

Definition at line 104 of file spinlock.h.


Friends And Related Function Documentation

friend struct SpinLockTest [friend]

Definition at line 141 of file spinlock.h.


Member Data Documentation

std::atomic<uint32_t> absl::base_internal::SpinLock::lockword_ [private]

Definition at line 174 of file spinlock.h.


The documentation for this class was generated from the following files:


abseil_cpp
Author(s):
autogenerated on Wed Jun 19 2019 19:42:16