struct ThreadIdentity
Defined at line 142 of file ../../third_party/abseil-cpp/src/absl/base/internal/thread_identity.h
The instances of this class are allocated in NewThreadIdentity() with an
alignment of PerThreadSynch::kAlignment and never destroyed. Initialization
should happen in OneTimeInitThreadIdentity().
Instances may be reused by new threads - fields should be reset in
ResetThreadIdentityBetweenReuse().
NOTE: The layout of fields in this structure is critical, please do not
add, remove, or modify the field placements without fully auditing the
layout.
Public Members
PerThreadSynch per_thread_synch
SchedulerState scheduler_state
atomic wait_state
char[31] padding
WaiterState waiter_state
std::atomic<int> * blocked_count_ptr
atomic ticker
atomic wait_start
atomic is_idle
int static_initialization_depth
ThreadIdentity * next
Enumerations
enum class WaitState : uint8_t
| Name | Value |
|---|---|
| kActive | 0 |
| kWaitingForWork | 1 |
For worker threads that may not be doing any interesting user work, this
tracks the current state of the worker. This is used to handle those
threads differently e.g. when printing stacktraces.
It should only be written to by the thread itself.
Note that this is different from the mutex idle bit - threads running user
work can be waiting but still be active.
Note: not all parts of the code-base may maintain this field correctly and
therefore this field should only be used to improve debugging/monitoring.
Put it here to reuse some of the padding space.
Defined at line 182 of file ../../third_party/abseil-cpp/src/absl/base/internal/thread_identity.h