aboutsummaryrefslogtreecommitdiffhomepage
path: root/absl/base/internal
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2017-11-13 10:04:29 -0800
committerGravatar John Olson <jolson@google.com>2017-11-13 16:52:47 -0500
commit95ddf85f8075d5645a754bac5742b72ec9c81f2a (patch)
tree71008ea1f200d829507e651f49a5fdb6d92cf1c2 /absl/base/internal
parent9e94e488f5006172245b2f977ab207ee140aca43 (diff)
Changes imported from Abseil "staging" branch:
- 5677afe8f626bb9db6d8bf9f25ba3d835ffa12d6 Internal TSAN bookkeeping change. by Greg Falcon <gfalcon@google.com> - c7492bad6fe6c8f106d3fcb1f8a939ea73b1a962 MSVC fix. by Alex Strelnikov <strel@google.com> GitOrigin-RevId: 5677afe8f626bb9db6d8bf9f25ba3d835ffa12d6 Change-Id: I1b8497508c8005a094824b4ccf9b220812b81bdb
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/spinlock.cc4
-rw-r--r--absl/base/internal/spinlock.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/absl/base/internal/spinlock.cc b/absl/base/internal/spinlock.cc
index 517668d..3ac1f4d 100644
--- a/absl/base/internal/spinlock.cc
+++ b/absl/base/internal/spinlock.cc
@@ -91,12 +91,12 @@ static inline bool IsCooperative(
// Uncommon constructors.
SpinLock::SpinLock(base_internal::SchedulingMode mode)
: lockword_(IsCooperative(mode) ? kSpinLockCooperative : 0) {
- ABSL_TSAN_MUTEX_CREATE(this, 0);
+ ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);
}
SpinLock::SpinLock(base_internal::LinkerInitialized,
base_internal::SchedulingMode mode) {
- ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_linker_init);
+ ABSL_TSAN_MUTEX_CREATE(this, 0);
if (IsCooperative(mode)) {
InitLinkerInitializedAndCooperative();
}
diff --git a/absl/base/internal/spinlock.h b/absl/base/internal/spinlock.h
index 1f50d74..f486f68 100644
--- a/absl/base/internal/spinlock.h
+++ b/absl/base/internal/spinlock.h
@@ -50,7 +50,7 @@ namespace base_internal {
class LOCKABLE SpinLock {
public:
SpinLock() : lockword_(kSpinLockCooperative) {
- ABSL_TSAN_MUTEX_CREATE(this, 0);
+ ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);
}
// Special constructor for use with static SpinLock objects. E.g.,
@@ -64,7 +64,7 @@ class LOCKABLE SpinLock {
// initializers run.
explicit SpinLock(base_internal::LinkerInitialized) {
// Does nothing; lockword_ is already initialized
- ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_linker_init);
+ ABSL_TSAN_MUTEX_CREATE(this, 0);
}
// Constructors that allow non-cooperative spinlocks to be created for use
@@ -73,7 +73,7 @@ class LOCKABLE SpinLock {
SpinLock(base_internal::LinkerInitialized,
base_internal::SchedulingMode mode);
- ~SpinLock() { ABSL_TSAN_MUTEX_DESTROY(this, 0); }
+ ~SpinLock() { ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static); }
// Acquire this SpinLock.
inline void Lock() EXCLUSIVE_LOCK_FUNCTION() {