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,8 +771,10 @@ class SharedMutexImpl : std::conditional_t<
void annotateDestroy() {
if (AnnotateForThreadSanitizer) {
annotateLazyCreate();
annotate_rwlock_destroy(this, __FILE__, __LINE__);
// call destroy only if the annotation was created
if (state_.load() & kAnnotationCreated) {
annotate_rwlock_destroy(this, __FILE__, __LINE__);
}
}
}
......
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