summaryrefslogtreecommitdiff
path: root/absl/base/internal/thread_identity.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-06-20 10:53:00 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-06-20 10:54:11 -0700
commitcffa80b913305c7ff6d6464e7efda23bb48bfa91 (patch)
tree4e580f25254f7e8173f32e8e446c7e476ef596b8 /absl/base/internal/thread_identity.h
parent5668c20e027f161eeb0b0bfe6ddbc814705c1c6b (diff)
absl: reformat Mutex-related files
Reformat Mutex-related files so that incremental formatting changes don't distract during review of logical changes. These files are subtle and any unnecessary diffs make reviews harder. No changes besides running clang-format. PiperOrigin-RevId: 541981737 Change-Id: I41cccb7a97158c78d17adaff6fe553c2c9c2b9ed
Diffstat (limited to 'absl/base/internal/thread_identity.h')
-rw-r--r--absl/base/internal/thread_identity.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/absl/base/internal/thread_identity.h b/absl/base/internal/thread_identity.h
index 496ec214..b6e917ce 100644
--- a/absl/base/internal/thread_identity.h
+++ b/absl/base/internal/thread_identity.h
@@ -62,8 +62,8 @@ struct PerThreadSynch {
return reinterpret_cast<ThreadIdentity*>(this);
}
- PerThreadSynch *next; // Circular waiter queue; initialized to 0.
- PerThreadSynch *skip; // If non-zero, all entries in Mutex queue
+ PerThreadSynch* next; // Circular waiter queue; initialized to 0.
+ PerThreadSynch* skip; // If non-zero, all entries in Mutex queue
// up to and including "skip" have same
// condition as this, and will be woken later
bool may_skip; // if false while on mutex queue, a mutex unlocker
@@ -104,10 +104,7 @@ struct PerThreadSynch {
//
// Transitions from kAvailable to kQueued require no barrier, they
// are externally ordered by the Mutex.
- enum State {
- kAvailable,
- kQueued
- };
+ enum State { kAvailable, kQueued };
std::atomic<State> state;
// The wait parameters of the current wait. waitp is null if the
@@ -122,14 +119,14 @@ struct PerThreadSynch {
// pointer unchanged.
SynchWaitParams* waitp;
- intptr_t readers; // Number of readers in mutex.
+ intptr_t readers; // Number of readers in mutex.
// When priority will next be read (cycles).
int64_t next_priority_read_cycles;
// Locks held; used during deadlock detection.
// Allocated in Synch_GetAllLocks() and freed in ReclaimThreadIdentity().
- SynchLocksHeld *all_locks;
+ SynchLocksHeld* all_locks;
};
// The instances of this class are allocated in NewThreadIdentity() with an
@@ -220,7 +217,7 @@ void ClearCurrentThreadIdentity();
#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11
#elif defined(__APPLE__) && defined(ABSL_HAVE_THREAD_LOCAL)
#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11
-#elif ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \
+#elif ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \
(__GOOGLE_GRTE_VERSION__ >= 20140228L)
// Support for async-safe TLS was specifically added in GRTEv4. It's not
// present in the upstream eglibc.