tsan: fix handling of condition variable destruction
authorDmitry Vyukov <dvyukov@google.com>
Tue, 30 Jun 2015 17:23:29 +0000 (17:23 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Tue, 30 Jun 2015 17:23:29 +0000 (17:23 +0000)
commit1d9b5e6eced452c671e77ac924bd1fd4808716ee
treed8287c2f86f35b45d9bacd439a45513056cf9bc7
parent01ee64c2eaf996a5360a4a81f12c260868e107fd
tsan: fix handling of condition variable destruction

POSIX states that "It shall be safe to destroy an initialized condition
variable upon which no threads are currently blocked", and later clarifies
"A condition variable can be destroyed immediately after all the threads
that are blocked on it are awakened) (in examples section). Tsan reported
such destruction as a data race.
Fixes https://llvm.org/bugs/show_bug.cgi?id=23616
Reviewed in http://reviews.llvm.org/D10693

llvm-svn: 241082
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
compiler-rt/test/tsan/cond_destruction.cc [new file with mode: 0644]