Changeset View
Changeset View
Standalone View
Standalone View
src/sync.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
potential_deadlock_detected(const std::pair<void *, void *> &mismatch, | potential_deadlock_detected(const std::pair<void *, void *> &mismatch, | ||||
const LockStack &s1, const LockStack &s2) { | const LockStack &s1, const LockStack &s2) { | ||||
LogPrintf("POTENTIAL DEADLOCK DETECTED\n"); | LogPrintf("POTENTIAL DEADLOCK DETECTED\n"); | ||||
LogPrintf("Previous lock order was:\n"); | LogPrintf("Previous lock order was:\n"); | ||||
for (const std::pair<void *, CLockLocation> &i : s2) { | for (const std::pair<void *, CLockLocation> &i : s2) { | ||||
if (i.first == mismatch.first) { | if (i.first == mismatch.first) { | ||||
LogPrintf(" (1)"); | LogPrintfToBeContinued(" (1)"); | ||||
} | } | ||||
if (i.first == mismatch.second) { | if (i.first == mismatch.second) { | ||||
LogPrintf(" (2)"); | LogPrintfToBeContinued(" (2)"); | ||||
} | } | ||||
LogPrintf(" %s\n", i.second.ToString()); | LogPrintf(" %s\n", i.second.ToString()); | ||||
} | } | ||||
LogPrintf("Current lock order is:\n"); | LogPrintf("Current lock order is:\n"); | ||||
for (const std::pair<void *, CLockLocation> &i : s1) { | for (const std::pair<void *, CLockLocation> &i : s1) { | ||||
if (i.first == mismatch.first) { | if (i.first == mismatch.first) { | ||||
LogPrintf(" (1)"); | LogPrintfToBeContinued(" (1)"); | ||||
} | } | ||||
if (i.first == mismatch.second) { | if (i.first == mismatch.second) { | ||||
LogPrintf(" (2)"); | LogPrintfToBeContinued(" (2)"); | ||||
} | } | ||||
LogPrintf(" %s\n", i.second.ToString()); | LogPrintf(" %s\n", i.second.ToString()); | ||||
} | } | ||||
if (g_debug_lockorder_abort) { | if (g_debug_lockorder_abort) { | ||||
fprintf(stderr, | fprintf(stderr, | ||||
"Assertion failed: detected inconsistent lock order at %s:%i, " | "Assertion failed: detected inconsistent lock order at %s:%i, " | ||||
"details in debug log.\n", | "details in debug log.\n", | ||||
__FILE__, __LINE__); | __FILE__, __LINE__); | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |