[sanitizer] Don't reuse the main thread in ThreadRegistry
authorKuba Brecka <kuba.brecka@gmail.com>
Mon, 2 May 2016 15:06:08 +0000 (15:06 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Mon, 2 May 2016 15:06:08 +0000 (15:06 +0000)
commitd052a579008b239a856c0fe055cb25b3cb3a8fd2
treedf40b8c40b66355c75c416e1570a8102cb255e6e
parente5e04baf950b0e7dd7333a543058685a5696e47f
[sanitizer] Don't reuse the main thread in ThreadRegistry

There is a hard-to-reproduce crash happening on OS X that involves terminating the main thread (dispatch_main does that, see discussion at http://reviews.llvm.org/D18496) and later reusing the main thread's ThreadContext. This patch disables reuse of the main thread. I believe this problem exists only on OS X, because on other systems the main thread cannot be terminated without exiting the process.

Differential Revision: http://reviews.llvm.org/D19722

llvm-svn: 268238
compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cc