Commit 8aeb9ba9 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

SharedMutex TSAN: call destroy only if the annotation was created

Summary:
SharedMutex TSAN: call destroy only if the annotation was created

(Note: this ignores all push blocking failures!)

Reviewed By: yfeldblum

Differential Revision: D27379654

fbshipit-source-id: 90be62eb9e932c83e025a96dd36c4cba992e6267
parent 6d8bd01c
...@@ -771,10 +771,12 @@ class SharedMutexImpl : std::conditional_t< ...@@ -771,10 +771,12 @@ class SharedMutexImpl : std::conditional_t<
void annotateDestroy() { void annotateDestroy() {
if (AnnotateForThreadSanitizer) { if (AnnotateForThreadSanitizer) {
annotateLazyCreate(); // call destroy only if the annotation was created
if (state_.load() & kAnnotationCreated) {
annotate_rwlock_destroy(this, __FILE__, __LINE__); annotate_rwlock_destroy(this, __FILE__, __LINE__);
} }
} }
}
void annotateAcquired(annotate_rwlock_level w) { void annotateAcquired(annotate_rwlock_level w) {
if (AnnotateForThreadSanitizer) { if (AnnotateForThreadSanitizer) {
......
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