Public Member Functions | Static Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
absl::base_internal::SpinLock Class Reference

#include <spinlock.h>

Public Member Functions

void AssertHeld () const ABSL_ASSERT_EXCLUSIVE_LOCK()
 
bool IsHeld () const
 
bool IsHeld () const
 
void Lock () ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
void Lock () ABSL_EXCLUSIVE_LOCK_FUNCTION()
 
 SpinLock ()
 
 SpinLock ()
 
constexpr SpinLock (absl::ConstInitType, base_internal::SchedulingMode mode)
 
constexpr SpinLock (absl::ConstInitType, base_internal::SchedulingMode mode)
 
 SpinLock (base_internal::SchedulingMode mode)
 
 SpinLock (base_internal::SchedulingMode mode)
 
bool TryLock () ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
bool TryLock () ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true)
 
void Unlock () ABSL_UNLOCK_FUNCTION()
 
void Unlock () ABSL_UNLOCK_FUNCTION()
 
 ~SpinLock ()=default
 
 ~SpinLock ()=default
 

Static Protected Member Functions

static uint64_t DecodeWaitCycles (uint32_t lock_value)
 
static uint64_t DecodeWaitCycles (uint32_t lock_value)
 
static uint32_t EncodeWaitCycles (int64_t wait_start_time, int64_t wait_end_time)
 
static uint32_t EncodeWaitCycles (int64_t wait_start_time, int64_t wait_end_time)
 

Private Member Functions

SpinLockoperator= (const SpinLock &)=delete
 
SpinLockoperator= (const SpinLock &)=delete
 
void SlowLock () ABSL_ATTRIBUTE_COLD
 
void SlowLock () ABSL_ATTRIBUTE_COLD
 
void SlowUnlock (uint32_t lock_value) ABSL_ATTRIBUTE_COLD
 
void SlowUnlock (uint32_t lock_value) ABSL_ATTRIBUTE_COLD
 
 SpinLock (const SpinLock &)=delete
 
 SpinLock (const SpinLock &)=delete
 
uint32_t SpinLoop ()
 
uint32_t SpinLoop ()
 
bool TryLockImpl ()
 
bool TryLockImpl ()
 
uint32_t TryLockInternal (uint32_t lock_value, uint32_t wait_cycles)
 
uint32_t TryLockInternal (uint32_t lock_value, uint32_t wait_cycles)
 

Static Private Member Functions

static constexpr bool IsCooperative (base_internal::SchedulingMode scheduling_mode)
 
static constexpr bool IsCooperative (base_internal::SchedulingMode scheduling_mode)
 

Private Attributes

std::atomic< uint32_tlockword_
 

Static Private Attributes

static constexpr uint32_t kSpinLockCooperative = 2
 
static constexpr uint32_t kSpinLockDisabledScheduling = 4
 
static constexpr uint32_t kSpinLockHeld = 1
 
static constexpr uint32_t kSpinLockSleeper = 8
 
static constexpr uint32_t kWaitTimeMask
 

Friends

struct SpinLockTest
 

Detailed Description

Definition at line 52 of file third_party/abseil-cpp/absl/base/internal/spinlock.h.

Constructor & Destructor Documentation

◆ SpinLock() [1/8]

absl::base_internal::SpinLock::SpinLock ( )
inline

◆ SpinLock() [2/8]

absl::base_internal::SpinLock::SpinLock ( base_internal::SchedulingMode  mode)
explicit

Definition at line 80 of file abseil-cpp/absl/base/internal/spinlock.cc.

◆ SpinLock() [3/8]

constexpr absl::base_internal::SpinLock::SpinLock ( absl::ConstInitType  ,
base_internal::SchedulingMode  mode 
)
inlineconstexpr

◆ ~SpinLock() [1/2]

absl::base_internal::SpinLock::~SpinLock ( )
default

◆ SpinLock() [4/8]

absl::base_internal::SpinLock::SpinLock ( const SpinLock )
privatedelete

◆ SpinLock() [5/8]

absl::base_internal::SpinLock::SpinLock ( )
inline

◆ SpinLock() [6/8]

absl::base_internal::SpinLock::SpinLock ( base_internal::SchedulingMode  mode)
explicit

◆ SpinLock() [7/8]

constexpr absl::base_internal::SpinLock::SpinLock ( absl::ConstInitType  ,
base_internal::SchedulingMode  mode 
)
inlineconstexpr

◆ ~SpinLock() [2/2]

absl::base_internal::SpinLock::~SpinLock ( )
default

◆ SpinLock() [8/8]

absl::base_internal::SpinLock::SpinLock ( const SpinLock )
privatedelete

Member Function Documentation

◆ AssertHeld()

void absl::base_internal::SpinLock::AssertHeld ( ) const
inline

◆ DecodeWaitCycles() [1/2]

static uint64_t absl::base_internal::SpinLock::DecodeWaitCycles ( uint32_t  lock_value)
staticprotected

◆ DecodeWaitCycles() [2/2]

uint64_t absl::base_internal::SpinLock::DecodeWaitCycles ( uint32_t  lock_value)
staticprotected

Definition at line 223 of file abseil-cpp/absl/base/internal/spinlock.cc.

◆ EncodeWaitCycles() [1/2]

static uint32_t absl::base_internal::SpinLock::EncodeWaitCycles ( int64_t  wait_start_time,
int64_t  wait_end_time 
)
staticprotected

◆ EncodeWaitCycles() [2/2]

uint32_t absl::base_internal::SpinLock::EncodeWaitCycles ( int64_t  wait_start_time,
int64_t  wait_end_time 
)
staticprotected

Definition at line 199 of file abseil-cpp/absl/base/internal/spinlock.cc.

◆ IsCooperative() [1/2]

static constexpr bool absl::base_internal::SpinLock::IsCooperative ( base_internal::SchedulingMode  scheduling_mode)
inlinestaticconstexprprivate

◆ IsCooperative() [2/2]

static constexpr bool absl::base_internal::SpinLock::IsCooperative ( base_internal::SchedulingMode  scheduling_mode)
inlinestaticconstexprprivate

◆ IsHeld() [1/2]

bool absl::base_internal::SpinLock::IsHeld ( ) const
inline

◆ IsHeld() [2/2]

bool absl::base_internal::SpinLock::IsHeld ( ) const
inline

◆ Lock() [1/2]

void absl::base_internal::SpinLock::Lock ( )
inline

◆ Lock() [2/2]

void absl::base_internal::SpinLock::Lock ( )
inline

◆ operator=() [1/2]

SpinLock& absl::base_internal::SpinLock::operator= ( const SpinLock )
privatedelete

◆ operator=() [2/2]

SpinLock& absl::base_internal::SpinLock::operator= ( const SpinLock )
privatedelete

◆ SlowLock() [1/2]

void absl::base_internal::SpinLock::SlowLock ( )
private

◆ SlowLock() [2/2]

void absl::base_internal::SpinLock::SlowLock ( )
private

Definition at line 105 of file abseil-cpp/absl/base/internal/spinlock.cc.

◆ SlowUnlock() [1/2]

void absl::base_internal::SpinLock::SlowUnlock ( uint32_t  lock_value)
private

◆ SlowUnlock() [2/2]

void absl::base_internal::SpinLock::SlowUnlock ( uint32_t  lock_value)
private

Definition at line 173 of file abseil-cpp/absl/base/internal/spinlock.cc.

◆ SpinLoop() [1/2]

uint32_t absl::base_internal::SpinLock::SpinLoop ( )
private

◆ SpinLoop() [2/2]

uint32_t absl::base_internal::SpinLock::SpinLoop ( )
private

Definition at line 88 of file abseil-cpp/absl/base/internal/spinlock.cc.

◆ TryLock() [1/2]

bool absl::base_internal::SpinLock::TryLock ( )
inline

◆ TryLock() [2/2]

bool absl::base_internal::SpinLock::TryLock ( )
inline

◆ TryLockImpl() [1/2]

bool absl::base_internal::SpinLock::TryLockImpl ( )
inlineprivate

◆ TryLockImpl() [2/2]

bool absl::base_internal::SpinLock::TryLockImpl ( )
inlineprivate

◆ TryLockInternal() [1/2]

uint32_t absl::base_internal::SpinLock::TryLockInternal ( uint32_t  lock_value,
uint32_t  wait_cycles 
)
private

◆ TryLockInternal() [2/2]

uint32_t absl::base_internal::SpinLock::TryLockInternal ( uint32_t  lock_value,
uint32_t  wait_cycles 
)
inlineprivate

◆ Unlock() [1/2]

void absl::base_internal::SpinLock::Unlock ( )
inline

◆ Unlock() [2/2]

void absl::base_internal::SpinLock::Unlock ( )
inline

Friends And Related Function Documentation

◆ SpinLockTest

SpinLockTest
friend

Member Data Documentation

◆ kSpinLockCooperative

static constexpr uint32_t absl::base_internal::SpinLock::kSpinLockCooperative = 2
staticconstexprprivate

◆ kSpinLockDisabledScheduling

static constexpr uint32_t absl::base_internal::SpinLock::kSpinLockDisabledScheduling = 4
staticconstexprprivate

◆ kSpinLockHeld

static constexpr uint32_t absl::base_internal::SpinLock::kSpinLockHeld = 1
staticconstexprprivate

◆ kSpinLockSleeper

static constexpr uint32_t absl::base_internal::SpinLock::kSpinLockSleeper = 8
staticconstexprprivate

◆ kWaitTimeMask

static constexpr uint32_t absl::base_internal::SpinLock::kWaitTimeMask
staticconstexprprivate

◆ lockword_

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

The documentation for this class was generated from the following files:
absl::base_internal::SpinLock::kSpinLockCooperative
static constexpr uint32_t kSpinLockCooperative
Definition: third_party/abseil-cpp/absl/base/internal/spinlock.h:165
absl::base_internal::SpinLock::kSpinLockDisabledScheduling
static constexpr uint32_t kSpinLockDisabledScheduling
Definition: third_party/abseil-cpp/absl/base/internal/spinlock.h:166
absl::base_internal::SpinLock::kSpinLockHeld
static constexpr uint32_t kSpinLockHeld
Definition: third_party/abseil-cpp/absl/base/internal/spinlock.h:164


grpc
Author(s):
autogenerated on Fri May 16 2025 03:02:27