diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-09-02 17:35:30 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-09-02 17:35:30 +0200 |
commit | 7a15d4ff67c9a6e3b6b5a63f82f76ffe1937c3b8 (patch) | |
tree | 8ac8a0e7b9994ade96f635dd261c5ae46703f7df /src/util.cpp | |
parent | f43f46c175d7e6d7426536f8efcad05d2eafba80 (diff) | |
parent | 86fd7c5af6cf3f907c50cf25ff844cd23e271c70 (diff) |
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Conflicts:
src/main.cpp
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp index 974e54c391..3c53771baf 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -940,17 +940,21 @@ static std::map<std::pair<CCriticalSection*, CCriticalSection*>, LockStack> lock static boost::thread_specific_ptr<LockStack> lockstack; -static void potential_deadlock_detected(const LockStack& s1, const LockStack& s2) +static void potential_deadlock_detected(const std::pair<CCriticalSection*, CCriticalSection*>& mismatch, const LockStack& s1, const LockStack& s2) { printf("POTENTIAL DEADLOCK DETECTED\n"); printf("Previous lock order was:\n"); BOOST_FOREACH(const PAIRTYPE(CCriticalSection*, CLockLocation)& i, s2) { + if (i.first == mismatch.first) printf(" (1)"); + if (i.first == mismatch.second) printf(" (2)"); printf(" %s %s:%d\n", i.second.mutexName.c_str(), i.second.sourceFile.c_str(), i.second.sourceLine); } printf("Current lock order is:\n"); BOOST_FOREACH(const PAIRTYPE(CCriticalSection*, CLockLocation)& i, s1) { + if (i.first == mismatch.first) printf(" (1)"); + if (i.first == mismatch.second) printf(" (2)"); printf(" %s %s:%d\n", i.second.mutexName.c_str(), i.second.sourceFile.c_str(), i.second.sourceLine); } } @@ -977,7 +981,7 @@ static void push_lock(CCriticalSection* c, const CLockLocation& locklocation) std::pair<CCriticalSection*, CCriticalSection*> p2 = std::make_pair(c, i.first); if (lockorders.count(p2)) { - potential_deadlock_detected(lockorders[p2], lockorders[p1]); + potential_deadlock_detected(p1, lockorders[p2], lockorders[p1]); break; } } |