Commit a7012a5b by Chris Kennelly Committed by Copybara-Service

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
parent 14b8a4ea
...@@ -53,7 +53,7 @@ namespace absl { ...@@ -53,7 +53,7 @@ namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
namespace base_internal { namespace base_internal {
class ABSL_LOCKABLE SpinLock { class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
public: public:
SpinLock() : lockword_(kSpinLockCooperative) { SpinLock() : lockword_(kSpinLockCooperative) {
ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment