summaryrefslogtreecommitdiff
path: root/absl/base/internal
diff options
context:
space:
mode:
authorGravatar Chris Kennelly <ckennelly@google.com>2024-02-20 07:40:26 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-02-20 07:41:44 -0800
commita7012a5bfcf26a41b9dd32d4c429004773503dd6 (patch)
tree3202c48a8221a5539227b6650f080b5b6f65b645 /absl/base/internal
parent14b8a4eac3e5a7b97ba4cc7b7dadf2a85aae8215 (diff)
Annotate that SpinLock should warn when unused.
This often indicates a bug from adding synchronization logic but not using it. PiperOrigin-RevId: 608600311 Change-Id: I48bc3ae18b1e9a00b5e2152f33b486cd6be324a1
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/spinlock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/base/internal/spinlock.h b/absl/base/internal/spinlock.h
index 2929cd6f..36f823ad 100644
--- a/absl/base/internal/spinlock.h
+++ b/absl/base/internal/spinlock.h
@@ -53,7 +53,7 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace base_internal {
-class ABSL_LOCKABLE SpinLock {
+class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
public:
SpinLock() : lockword_(kSpinLockCooperative) {
ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);