summaryrefslogtreecommitdiff
path: root/libsanitizer/sanitizer_common/sanitizer_mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsanitizer/sanitizer_common/sanitizer_mutex.h')
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_mutex.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_mutex.h b/libsanitizer/sanitizer_common/sanitizer_mutex.h
index b3501146279..d78f43edaae 100644
--- a/libsanitizer/sanitizer_common/sanitizer_mutex.h
+++ b/libsanitizer/sanitizer_common/sanitizer_mutex.h
@@ -38,6 +38,10 @@ class StaticSpinMutex {
atomic_store(&state_, 0, memory_order_release);
}
+ void CheckLocked() {
+ CHECK_EQ(atomic_load(&state_, memory_order_relaxed), 1);
+ }
+
private:
atomic_uint8_t state_;