Skip to content

Commit 0ecff9d

Browse files
committed
Improve "detected inconsistent lock order" error message
1 parent bbe9cf4 commit 0ecff9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sync.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct CLockLocation {
6060
std::string ToString() const
6161
{
6262
return strprintf(
63-
"%s %s:%s%s (in thread %s)",
63+
"'%s' in %s:%s%s (in thread '%s')",
6464
mutexName, sourceFile, sourceLine, (fTry ? " (TRY)" : ""), m_thread_name);
6565
}
6666

@@ -129,7 +129,7 @@ static void potential_deadlock_detected(const LockPair& mismatch, const LockStac
129129
LogPrintf(" %s\n", i.second.ToString());
130130
}
131131
if (g_debug_lockorder_abort) {
132-
tfm::format(std::cerr, "Assertion failed: detected inconsistent lock order at %s:%i, details in debug log.\n", __FILE__, __LINE__);
132+
tfm::format(std::cerr, "Assertion failed: detected inconsistent lock order for %s, details in debug log.\n", s2.back().second.ToString());
133133
abort();
134134
}
135135
throw std::logic_error(strprintf("potential deadlock detected: %s -> %s -> %s", mutex_b, mutex_a, mutex_b));

0 commit comments

Comments
 (0)