20 #ifndef ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ 21 #define ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ 37 struct SynchLocksHeld;
38 struct SynchWaitParams;
40 namespace base_internal {
43 struct ThreadIdentity;
189 #ifdef ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 190 #error ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC cannot be direcly set 192 #define ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 0 195 #ifdef ABSL_THREAD_IDENTITY_MODE_USE_TLS 196 #error ABSL_THREAD_IDENTITY_MODE_USE_TLS cannot be direcly set 198 #define ABSL_THREAD_IDENTITY_MODE_USE_TLS 1 201 #ifdef ABSL_THREAD_IDENTITY_MODE_USE_CPP11 202 #error ABSL_THREAD_IDENTITY_MODE_USE_CPP11 cannot be direcly set 204 #define ABSL_THREAD_IDENTITY_MODE_USE_CPP11 2 207 #ifdef ABSL_THREAD_IDENTITY_MODE 208 #error ABSL_THREAD_IDENTITY_MODE cannot be direcly set 209 #elif defined(ABSL_FORCE_THREAD_IDENTITY_MODE) 210 #define ABSL_THREAD_IDENTITY_MODE ABSL_FORCE_THREAD_IDENTITY_MODE 211 #elif defined(_WIN32) 212 #define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11 213 #elif ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \ 214 (__GOOGLE_GRTE_VERSION__ >= 20140228L) 218 #define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_TLS 220 #define ABSL_THREAD_IDENTITY_MODE \ 221 ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 224 #if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ 225 ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 233 #elif ABSL_THREAD_IDENTITY_MODE != \ 234 ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 235 #error Unknown ABSL_THREAD_IDENTITY_MODE 241 #endif // ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_
ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity * thread_identity_ptr
void(*)(void *) ThreadIdentityReclaimerFunction
ThreadIdentity * CurrentThreadIdentityIfPresent()
bool suppress_fatal_errors
std::atomic< bool > is_idle
int64_t next_priority_read_cycles
std::atomic< int > * blocked_count_ptr
PerThreadSynch per_thread_synch
std::atomic< int > wait_start
ThreadIdentity * thread_identity()
static char data[kDataSize]
static constexpr int kLowZeroBits
void SetCurrentThreadIdentity(ThreadIdentity *identity, ThreadIdentityReclaimerFunction reclaimer)
void ClearCurrentThreadIdentity()
static constexpr int kAlignment
std::atomic< int > ticker
#define ABSL_PER_THREAD_TLS_KEYWORD
std::atomic< State > state
SynchLocksHeld * all_locks