summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-05-01 10:01:13 +0000
committerDmitry Vyukov <dvyukov@google.com>2017-05-01 10:01:13 +0000
commit1531d487bd209ea8b183db067a0a2161a5db9b4b (patch)
treeec7dc795a27875eca1f21a6df88d2d9f40d8e303 /include
parentd816020bbf906c6452e8911151abb688176c2ef5 (diff)
tsan: support linker init flag in __tsan_mutex_destroy
For a linker init mutex with lazy flag setup (no __tsan_mutex_create call), it is possible that no lock/unlock happened before the destroy call. Then when destroy runs we still don't know that it is a linker init mutex and will emulate a memory write. This in turn can lead to false positives as the mutex is in fact linker initialized. Support linker init flag in destroy annotation to resolve this. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/sanitizer/tsan_interface.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sanitizer/tsan_interface.h b/include/sanitizer/tsan_interface.h
index 45e54f758..a0c702638 100644
--- a/include/sanitizer/tsan_interface.h
+++ b/include/sanitizer/tsan_interface.h
@@ -68,7 +68,8 @@ const unsigned __tsan_mutex_recursive_unlock = 1 << 7;
void __tsan_mutex_create(void *addr, unsigned flags);
// Annotate destruction of a mutex.
-// Supported flags: none.
+// Supported flags:
+// - __tsan_mutex_linker_init
void __tsan_mutex_destroy(void *addr, unsigned flags);
// Annotate start of lock operation.