Enumerations
enum SchedulingMode
| Name | Value |
|---|---|
| SCHEDULE_KERNEL_ONLY | 0 |
| SCHEDULE_COOPERATIVE_AND_KERNEL | 1 |
Used to describe how a thread may be scheduled. Typically associated with
the declaration of a resource supporting synchronized access.
SCHEDULE_COOPERATIVE_AND_KERNEL:
Specifies that when waiting, a cooperative thread (e.g. a Fiber) may
reschedule (using base::scheduling semantics); allowing other cooperative
threads to proceed.
SCHEDULE_KERNEL_ONLY: (Also described as "non-cooperative")
Specifies that no cooperative scheduling semantics may be used, even if the
current thread is itself cooperatively scheduled. This means that
cooperative threads will NOT allow other cooperative threads to execute in
their place while waiting for a resource of this type. Host operating system
semantics (e.g. a futex) may still be used.
When optional, clients should strongly prefer SCHEDULE_COOPERATIVE_AND_KERNEL
by default. SCHEDULE_KERNEL_ONLY should only be used for resources on which
base::scheduling (e.g. the implementation of a Scheduler) may depend.
NOTE: Cooperative resources may not be nested below non-cooperative ones.
This means that it is invalid to to acquire a SCHEDULE_COOPERATIVE_AND_KERNEL
resource if a SCHEDULE_KERNEL_ONLY resource is already held.
Defined at line 49 of file ../../third_party/abseil-cpp/absl/base/internal/scheduling_mode.h
Records
Functions
-
template <typename Callable, typename... Args>void CallOnceImpl (absl::Nonnull<std::atomic<uint32_t> *> control, base_internal::SchedulingMode scheduling_mode, Callable && fn, Args &&... args)Defined at line 150 of file ../../third_party/abseil-cpp/absl/base/call_once.h
-
void ThrowStdLogicError (const std::string & what_arg)Helper functions that allow throwing exceptions consistently from anywhere.
The main use case is for header-based libraries (eg templates), as they will
be built by many different targets with their own compiler options.
In particular, this will allow a safe way to throw exceptions even if the
caller is compiled with -fno-exceptions. This is intended for implementing
things like map
<
>::at(), which the standard documents as throwing an
exception on error.
Using other techniques like #if tricks could lead to ODR violations.
You shouldn't use it unless you're writing code that you know will be built
both with and without exceptions and you need to conform to an interface
that uses exceptions.
-
void ThrowStdLogicError (const char * what_arg) -
void ThrowStdInvalidArgument (const std::string & what_arg) -
uint32_t SpinLockWait (std::atomic<uint32_t> * w, int n, const SpinLockWaitTransition[] trans, SchedulingMode scheduling_mode)Wait until *w can transition from trans[i].from to trans[i].to for some i
satisfying 0
<
=i
<n
&
&
trans[i].done, atomically make the transition,
then return the old value of *w. Make any other atomic transitions
where !trans[i].done, but continue waiting.
Wakeups for threads blocked on SpinLockWait do not respect priorities.
-
void ThrowStdInvalidArgument (const char * what_arg) -
void ThrowStdDomainError (const std::string & what_arg) -
void ThrowStdDomainError (const char * what_arg) -
void ThrowStdLengthError (const std::string & what_arg) -
void ThrowStdLengthError (const char * what_arg) -
void ThrowStdOutOfRange (const std::string & what_arg) -
absl::Nonnull<std::atomic<uint32_t> *> ControlWord (absl::Nonnull<absl::once_flag *> flag)Defined at line 192 of file ../../third_party/abseil-cpp/absl/base/call_once.h
-
void ThrowStdOutOfRange (const char * what_arg) -
void SpinLockWake (std::atomic<uint32_t> * w, bool all)If possible, wake some thread that has called SpinLockDelay(w, ...). If `all`
is true, wake all such threads. On some systems, this may be a no-op; on
those systems, threads calling SpinLockDelay() will always wake eventually
even if SpinLockWake() is never called.
Defined at line 83 of file ../../third_party/abseil-cpp/absl/base/internal/spinlock_wait.h
-
template <typename T>T AnnotateUnprotectedRead (const volatile T & x)Defined at line 421 of file ../../third_party/abseil-cpp/absl/base/dynamic_annotations.h
-
void ThrowStdRuntimeError (const std::string & what_arg) -
void ThrowStdRuntimeError (const char * what_arg) -
void ThrowStdRangeError (const std::string & what_arg) -
void ThrowStdRangeError (const char * what_arg) -
void ThrowStdOverflowError (const std::string & what_arg) -
void ThrowStdOverflowError (const char * what_arg) -
void ThrowStdUnderflowError (const std::string & what_arg) -
void SpinLockDelay (std::atomic<uint32_t> * w, uint32_t value, int loop, base_internal::SchedulingMode scheduling_mode)Wait for an appropriate spin delay on iteration "loop" of a
spin loop on location *w, whose previously observed value was "value".
SpinLockDelay() may do nothing, may yield the CPU, may sleep a clock tick,
or may wait for a call to SpinLockWake(w).
Defined at line 88 of file ../../third_party/abseil-cpp/absl/base/internal/spinlock_wait.h
-
void ThrowStdUnderflowError (const char * what_arg) -
void ThrowStdBadFunctionCall () -
void ThrowStdBadAlloc () -
int SpinLockSuggestedDelayNS (int loop)Helper used by AbslInternalSpinLockDelay.
Returns a suggested delay in nanoseconds for iteration number "loop".
-
template <typename Callable, typename... Args>void LowLevelCallOnce (absl::Nonnull<absl::once_flag *> flag, Callable && fn, Args &&... args)Like call_once, but uses KERNEL_ONLY scheduling. Intended to be used to
initialize entities used by the scheduler implementation.
Defined at line 198 of file ../../third_party/abseil-cpp/absl/base/call_once.h
-
ThreadIdentity * CurrentThreadIdentityIfPresent ()Returns the ThreadIdentity object representing the calling thread; guaranteed
to be unique for its lifetime. The returned object will remain valid for the
program's lifetime; although it may be re-assigned to a subsequent thread.
If one does not exist, return nullptr instead.
Does not malloc(*), and is async-signal safe.
[*] Technically pthread_setspecific() does malloc on first use; however this
is handled internally within tcmalloc's initialization already. Note that
darwin does *not* use tcmalloc, so this can catch you if using MallocHooks
on Apple platforms. Whatever function is calling your MallocHooks will need
to watch for recursion on Apple platforms.
New ThreadIdentity objects can be constructed and associated with a thread
by calling GetOrCreateCurrentThreadIdentity() in per-thread-sem.h.
-
void SetCurrentThreadIdentity (ThreadIdentity * identity, ThreadIdentityReclaimerFunction reclaimer)Sets the current thread identity to the given value. 'reclaimer' is a
pointer to the global function for cleaning up instances on thread
destruction.
-
void ClearCurrentThreadIdentity ()Removes the currently associated ThreadIdentity from the running thread.
This must be called from inside the ThreadIdentityReclaimerFunction, and only
from that function.
-
void RegisterSpinLockProfiler (void (*)(const void *, int64_t) fn)Register a hook for profiling support.
The function pointer registered here will be called whenever a spinlock is
contended. The callback is given an opaque handle to the contended spinlock
and the number of wait cycles. This is thread-safe, but only a single
profiler can be registered. It is an error to call this function multiple
times with different arguments.
-
uint16_t UnalignedLoad16 (absl::Nonnull<const void *> p)Defined at line 39 of file ../../third_party/abseil-cpp/absl/base/internal/unaligned_access.h
-
uint32_t UnalignedLoad32 (absl::Nonnull<const void *> p)Defined at line 45 of file ../../third_party/abseil-cpp/absl/base/internal/unaligned_access.h
-
uint64_t UnalignedLoad64 (absl::Nonnull<const void *> p)Defined at line 51 of file ../../third_party/abseil-cpp/absl/base/internal/unaligned_access.h
-
void UnalignedStore16 (absl::Nonnull<void *> p, uint16_t v)Defined at line 57 of file ../../third_party/abseil-cpp/absl/base/internal/unaligned_access.h
-
void UnalignedStore32 (absl::Nonnull<void *> p, uint32_t v)Defined at line 61 of file ../../third_party/abseil-cpp/absl/base/internal/unaligned_access.h
-
void UnalignedStore64 (absl::Nonnull<void *> p, uint64_t v)Defined at line 65 of file ../../third_party/abseil-cpp/absl/base/internal/unaligned_access.h
-
template <typename T>const T & ts_unchecked_read (const T & v)Takes a reference to a guarded data member, and returns an unguarded
reference.
Do not use this function directly, use ABSL_TS_UNCHECKED_READ instead.
Defined at line 320 of file ../../third_party/abseil-cpp/absl/base/thread_annotations.h
-
template <typename T>T & ts_unchecked_read (T & v)Defined at line 325 of file ../../third_party/abseil-cpp/absl/base/thread_annotations.h