summaryrefslogtreecommitdiff
path: root/absl/base/internal/spinlock.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2020-05-14 16:04:20 -0700
committerGravatar Andy Getz <durandal@google.com>2020-05-14 20:49:06 -0400
commitd118d4bb115387cc52c5338221f2554a940e6d90 (patch)
tree0577459d15af3035aa51ee3869b72f6b1c4ea5a1 /absl/base/internal/spinlock.h
parentf2bc9d11e841e247c95f9f1426b367721d0a8fa6 (diff)
Export of internal Abseil changes
-- b8e6b64b604449bb51ed0ba8e9439097f3aa8773 by Abseil Team <absl-team@google.com>: fix typo 'implentation' -> 'implementation' PiperOrigin-RevId: 311623471 -- 2b9262a311f3329c8006835a79498edd90568acd by Matt Kulukundis <kfm@google.com>: Internal cleanup PiperOrigin-RevId: 311549039 -- 7507ed3c28113e28f993aa634bd44a9a0d4c4a2c by Derek Mauro <dmauro@google.com>: Delete LinkerInitialized Now that all SpinLocks have the same scheduling mode for their entire lives, the scheduling mode does not need to be re-tested in the loop in LockSlow. PiperOrigin-RevId: 311521474 -- abf5fae67e21b38cda4083aaafd7012e2c6fbb7d by Andy Getzendanner <durandal@google.com>: Fix public target name of the random library Import of https://github.com/abseil/abseil-cpp/pull/684 PiperOrigin-RevId: 311429555 GitOrigin-RevId: b8e6b64b604449bb51ed0ba8e9439097f3aa8773 Change-Id: Ic48f671846bda059cc46f4a0b967cc3b1a733ba0
Diffstat (limited to 'absl/base/internal/spinlock.h')
-rw-r--r--absl/base/internal/spinlock.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/absl/base/internal/spinlock.h b/absl/base/internal/spinlock.h
index 2b08a2d6..2222398b 100644
--- a/absl/base/internal/spinlock.h
+++ b/absl/base/internal/spinlock.h
@@ -56,27 +56,9 @@ class ABSL_LOCKABLE SpinLock {
ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);
}
- // Special constructor for use with static SpinLock objects. E.g.,
- //
- // static SpinLock lock(base_internal::kLinkerInitialized);
- //
- // When initialized using this constructor, we depend on the fact
- // that the linker has already initialized the memory appropriately. The lock
- // is initialized in non-cooperative mode.
- //
- // A SpinLock constructed like this can be freely used from global
- // initializers without worrying about the order in which global
- // initializers run.
- explicit SpinLock(base_internal::LinkerInitialized) {
- // Does nothing; lockword_ is already initialized
- ABSL_TSAN_MUTEX_CREATE(this, 0);
- }
-
// Constructors that allow non-cooperative spinlocks to be created for use
// inside thread schedulers. Normal clients should not use these.
explicit SpinLock(base_internal::SchedulingMode mode);
- SpinLock(base_internal::LinkerInitialized,
- base_internal::SchedulingMode mode);
// Constructor for global SpinLock instances. See absl/base/const_init.h.
constexpr SpinLock(absl::ConstInitType, base_internal::SchedulingMode mode)
@@ -168,7 +150,6 @@ class ABSL_LOCKABLE SpinLock {
}
uint32_t TryLockInternal(uint32_t lock_value, uint32_t wait_cycles);
- void InitLinkerInitializedAndCooperative();
void SlowLock() ABSL_ATTRIBUTE_COLD;
void SlowUnlock(uint32_t lock_value) ABSL_ATTRIBUTE_COLD;
uint32_t SpinLoop();