X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.cpp;h=3c53771baffabb4245fc9032176a33f3a703b4dd;hb=7a15d4ff67c9a6e3b6b5a63f82f76ffe1937c3b8;hp=974e54c391f7f6809b33d470ef3c4a6f887d6272;hpb=f43f46c175d7e6d7426536f8efcad05d2eafba80;p=novacoin.git diff --git a/src/util.cpp b/src/util.cpp index 974e54c..3c53771 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -940,17 +940,21 @@ static std::map, LockStack> lock static boost::thread_specific_ptr lockstack; -static void potential_deadlock_detected(const LockStack& s1, const LockStack& s2) +static void potential_deadlock_detected(const std::pair& 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 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; } }