Skip to content

Commit a7012a5

Browse files
ckennellycopybara-github
authored andcommitted
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
1 parent 14b8a4e commit a7012a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

absl/base/internal/spinlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace absl {
5353
ABSL_NAMESPACE_BEGIN
5454
namespace base_internal {
5555

56-
class ABSL_LOCKABLE SpinLock {
56+
class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
5757
public:
5858
SpinLock() : lockword_(kSpinLockCooperative) {
5959
ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);

0 commit comments

Comments
 (0)