diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-13 17:01:30 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-13 17:01:30 +0000 |
commit | a36fdeb039266f65e21a97e02e28b75b3a3a0517 (patch) | |
tree | 9b002e56f585cf7c0a09e33bccf6247735ae68b9 /libsanitizer/sanitizer_common | |
parent | 313079546d70b1716787b71332a426e9e8166995 (diff) | |
download | gcc-a36fdeb039266f65e21a97e02e28b75b3a3a0517.tar.gz |
* sanitizer_common/sanitizer_deadlock_detector.h: Cherry pick
upstream r224518 and r224519.
* tsan/tsan_rtl_thread.cc: Cherry pick upstream r224702 and
r224834.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219545 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer/sanitizer_common')
-rw-r--r-- | libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h b/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h index 949c486a14a..5c8317554ad 100644 --- a/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h +++ b/libsanitizer/sanitizer_common/sanitizer_deadlock_detector.h @@ -48,6 +48,8 @@ class DeadlockDetectorTLS { if (epoch_ == current_epoch) return; bv_.clear(); epoch_ = current_epoch; + n_recursive_locks = 0; + n_all_locks_ = 0; } uptr getEpoch() const { return epoch_; } @@ -81,7 +83,8 @@ class DeadlockDetectorTLS { } } // Printf("remLock: %zx %zx\n", lock_id, epoch_); - CHECK(bv_.clearBit(lock_id)); + if (!bv_.clearBit(lock_id)) + return; // probably addLock happened before flush if (n_all_locks_) { for (sptr i = n_all_locks_ - 1; i >= 0; i--) { if (all_locks_with_contexts_[i].lock == static_cast<u32>(lock_id)) { @@ -173,6 +176,7 @@ class DeadlockDetector { recycled_nodes_.clear(); available_nodes_.setAll(); g_.clear(); + n_edges_ = 0; return getAvailableNode(data); } |