Skip to content

Commit 6d3689f

Browse files
committed
sync: print proper lock order location when double lock is detected
Before: ``` Assertion failed: detected double lock at src/sync.cpp:153, details in debug log. ``` After: ``` Assertion failed: detected double lock for 'm' in src/test/sync_tests.cpp:40 (in thread ''), details in debug log. ```
1 parent 5009159 commit 6d3689f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sync.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ static void double_lock_detected(const void* mutex, LockStack& lock_stack)
150150
LogPrintf(" %s\n", i.second.ToString());
151151
}
152152
if (g_debug_lockorder_abort) {
153-
tfm::format(std::cerr, "Assertion failed: detected double lock at %s:%i, details in debug log.\n", __FILE__, __LINE__);
153+
tfm::format(std::cerr,
154+
"Assertion failed: detected double lock for %s, details in debug log.\n",
155+
lock_stack.back().second.ToString());
154156
abort();
155157
}
156158
throw std::logic_error("double lock detected");

0 commit comments

Comments
 (0)