[tsan] Support C++11 call_once in TSan on Darwin
authorKuba Brecka <kuba.brecka@gmail.com>
Thu, 8 Sep 2016 10:15:20 +0000 (10:15 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Thu, 8 Sep 2016 10:15:20 +0000 (10:15 +0000)
commit419ebb289104f75207dc5a5c56e75d497534eb8a
tree933dbd2212efbf207e2aecf0ac04bd0853a55ac1
parent2f1fbaebe25a4637cf75ec9ab1877c64584ede24
[tsan] Support C++11 call_once in TSan on Darwin

This patch adds a wrapper for call_once, which uses an already-compiled helper __call_once with an atomic release which is invisible to TSan. To avoid false positives, the interceptor performs an explicit atomic release in the callback wrapper.

Differential Revision: https://reviews.llvm.org/D24188

llvm-svn: 280920
compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cc
compiler-rt/test/tsan/Darwin/libcxx-call-once.mm [new file with mode: 0644]