summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-07-08 13:16:03 +0000
committerKostya Serebryany <kcc@google.com>2014-07-08 13:16:03 +0000
commit3d570b960e3c2dd201323c1005448c5db541f4f3 (patch)
tree27b5fbf18ee150f6d8ab64651cbd6e2084230905 /compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
parent324ad956e0cb6ccce9c0ce3d5fc2fa1fe86ab7fd (diff)
downloadbcm5719-llvm-3d570b960e3c2dd201323c1005448c5db541f4f3.tar.gz
bcm5719-llvm-3d570b960e3c2dd201323c1005448c5db541f4f3.zip
[tsan] fix deadlock detector's interoperation with java locks (https://code.google.com/p/thread-sanitizer/issues/detail?id=67)
llvm-svn: 212529
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
index 789010547a2..4cf47ecd1a6 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
@@ -172,7 +172,7 @@ void MutexLock(ThreadState *thr, uptr pc, uptr addr, int rec, bool try_lock) {
}
s->recursion += rec;
thr->mset.Add(s->GetId(), true, thr->fast_state.epoch());
- if (flags()->detect_deadlocks && s->recursion == 1) {
+ if (flags()->detect_deadlocks && (s->recursion - rec) == 0) {
Callback cb(thr, pc);
if (!try_lock)
ctx->dd->MutexBeforeLock(&cb, &s->dd, true);
OpenPOWER on IntegriCloud