Skip to content

Commit 1ec4a27

Browse files
ckennellycopybara-github
authored andcommitted
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
1 parent b59913e commit 1ec4a27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

absl/synchronization/mutex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct SynchWaitParams;
148148
//
149149
// See also `MutexLock`, below, for scoped `Mutex` acquisition.
150150

151-
class ABSL_LOCKABLE Mutex {
151+
class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
152152
public:
153153
// Creates a `Mutex` that is not held by anyone. This constructor is
154154
// typically used for Mutexes allocated on the heap or the stack.

0 commit comments

Comments
 (0)