tsan: fix deadlock during fork

ReportRace takes the two mutexes in the opposite order

llvm-svn: 204809
This commit is contained in:
Dmitry Vyukov 2014-03-26 14:13:31 +00:00
parent b979a55607
commit 5da31e03bf
1 changed files with 3 additions and 3 deletions

View File

@ -324,18 +324,18 @@ int Finalize(ThreadState *thr) {
#ifndef TSAN_GO
void ForkBefore(ThreadState *thr, uptr pc) {
ctx->report_mtx.Lock();
ctx->thread_registry->Lock();
ctx->report_mtx.Lock();
}
void ForkParentAfter(ThreadState *thr, uptr pc) {
ctx->thread_registry->Unlock();
ctx->report_mtx.Unlock();
ctx->thread_registry->Unlock();
}
void ForkChildAfter(ThreadState *thr, uptr pc) {
ctx->thread_registry->Unlock();
ctx->report_mtx.Unlock();
ctx->thread_registry->Unlock();
uptr nthread = 0;
ctx->thread_registry->GetNumberOfThreads(0, 0, &nthread /* alive threads */);