forked from OSchip/llvm-project
[tsan] Fix finalization of detached threads on OS X
Currently, we crash on finalization of detached threads, because we'll try to clear the ThreadState twice. Differential Revision: http://reviews.llvm.org/D14644 llvm-svn: 253079
This commit is contained in:
parent
d07e069d79
commit
7291b88e9a
|
@ -139,7 +139,7 @@ static void my_pthread_introspection_hook(unsigned int event, pthread_t thread,
|
|||
}
|
||||
} else if (event == PTHREAD_INTROSPECTION_THREAD_DESTROY) {
|
||||
ThreadState *thr = cur_thread();
|
||||
if (thr->tctx->parent_tid == kInvalidTid) {
|
||||
if (thr->tctx && thr->tctx->parent_tid == kInvalidTid) {
|
||||
DestroyThreadState();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue