Skip to content

Commit 8224c30

Browse files
ckennellycopybara-github
authored andcommitted
Mark SpinLock camel-cased methods as ready for inlining.
PiperOrigin-RevId: 790765458 Change-Id: Iff8cedf78a5b9d28eba63515d22e5ac35c34542c
1 parent f67705a commit 8224c30

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

absl/base/internal/spinlock.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
101101
ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0);
102102
}
103103

104+
ABSL_DEPRECATE_AND_INLINE()
104105
inline void Lock() ABSL_EXCLUSIVE_LOCK_FUNCTION() { return lock(); }
105106

106107
// Try to acquire this SpinLock without blocking and return true if the
@@ -116,6 +117,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
116117
return res;
117118
}
118119

120+
ABSL_DEPRECATE_AND_INLINE()
119121
[[nodiscard]] inline bool TryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
120122
return try_lock();
121123
}
@@ -139,6 +141,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
139141
ABSL_TSAN_MUTEX_POST_UNLOCK(this, 0);
140142
}
141143

144+
ABSL_DEPRECATE_AND_INLINE()
142145
inline void Unlock() ABSL_UNLOCK_FUNCTION() { unlock(); }
143146

144147
// Determine if the lock is held. When the lock is held by the invoking

0 commit comments

Comments
 (0)