From 1ec4a27e39944462a574abbfa040498ed2831cc8 Mon Sep 17 00:00:00 2001 From: Chris Kennelly Date: Thu, 4 Apr 2024 11:32:12 -0700 Subject: Annotate that Mutex should warn when unused. This often indicates a bug from adding synchronization logic but not using it. PiperOrigin-RevId: 621921486 Change-Id: Iec49134c5e4bb50d9fc728c1f8a4fd2e86856782 --- absl/synchronization/mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'absl/synchronization') diff --git a/absl/synchronization/mutex.h b/absl/synchronization/mutex.h index d53a22bb..95052252 100644 --- a/absl/synchronization/mutex.h +++ b/absl/synchronization/mutex.h @@ -148,7 +148,7 @@ struct SynchWaitParams; // // See also `MutexLock`, below, for scoped `Mutex` acquisition. -class ABSL_LOCKABLE Mutex { +class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex { public: // Creates a `Mutex` that is not held by anyone. This constructor is // typically used for Mutexes allocated on the heap or the stack. -- cgit v1.2.3