[compiler-rt] r202487 - [sanitizer] speedup deadlock detector for the case when we destroy a mutex that has never been locked

Kostya Serebryany kcc at google.com
Fri Feb 28 02:59:33 PST 2014


Author: kcc
Date: Fri Feb 28 04:59:33 2014
New Revision: 202487

URL: http://llvm.org/viewvc/llvm-project?rev=202487&view=rev
Log:
[sanitizer] speedup deadlock detector for the case when we destroy a mutex that has never been locked

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector1.cc
    compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector1.cc?rev=202487&r1=202486&r2=202487&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector1.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector1.cc Fri Feb 28 04:59:33 2014
@@ -132,6 +132,7 @@ DDReport *DDetectorImpl::MutexUnlock(DDP
 
 void DDetectorImpl::MutexDestroy(DDPhysicalThread *pt, DDLogicalThread *lt,
     DDMutex *m) {
+  if (!m->id) return;
   SpinMutexLock lk(&mtx);
   if (dd.nodeBelongsToCurrentEpoch(m->id))
     dd.removeNode(m->id);

Modified: compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc?rev=202487&r1=202486&r2=202487&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc (original)
+++ compiler-rt/trunk/test/tsan/deadlock_detector_stress_test.cc Fri Feb 28 04:59:33 2014
@@ -495,7 +495,7 @@ int main(int argc, char **argv) {
   LockTest().Test12();
   LockTest().Test13();
   LockTest().Test14();
-  // LockTest().Test15();  FIXME: this is broken for PthreadRWLock
+  // LockTest().Test15();  // FIXME: this is broken for PthreadRWLock
   fprintf(stderr, "ALL-DONE\n");
   // CHECK: ALL-DONE
 }





More information about the llvm-commits mailing list