summaryrefslogtreecommitdiff
path: root/absl/base/internal
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/low_level_scheduling.h5
-rw-r--r--absl/base/internal/spinlock.h7
2 files changed, 7 insertions, 5 deletions
diff --git a/absl/base/internal/low_level_scheduling.h b/absl/base/internal/low_level_scheduling.h
index 31261298..ed0b4bfa 100644
--- a/absl/base/internal/low_level_scheduling.h
+++ b/absl/base/internal/low_level_scheduling.h
@@ -29,9 +29,6 @@ extern "C" void __google_enable_rescheduling(bool disable_result);
namespace absl {
ABSL_NAMESPACE_BEGIN
-class CondVar;
-class Mutex;
-
namespace base_internal {
class SchedulingHelper; // To allow use of SchedulingGuard.
@@ -80,8 +77,6 @@ class SchedulingGuard {
};
// Access to SchedulingGuard is explicitly permitted.
- friend class absl::CondVar;
- friend class absl::Mutex;
friend class SchedulingHelper;
friend class SpinLock;
diff --git a/absl/base/internal/spinlock.h b/absl/base/internal/spinlock.h
index 2222398b..e6ac9e64 100644
--- a/absl/base/internal/spinlock.h
+++ b/absl/base/internal/spinlock.h
@@ -64,7 +64,14 @@ class ABSL_LOCKABLE SpinLock {
constexpr SpinLock(absl::ConstInitType, base_internal::SchedulingMode mode)
: lockword_(IsCooperative(mode) ? kSpinLockCooperative : 0) {}
+ // For global SpinLock instances prefer trivial destructor when possible.
+ // Default but non-trivial destructor in some build configurations causes an
+ // extra static initializer.
+#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE
~SpinLock() { ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static); }
+#else
+ ~SpinLock() = default;
+#endif
// Acquire this SpinLock.
inline void Lock() ABSL_EXCLUSIVE_LOCK_FUNCTION() {