mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-01 18:50:24 +02:00
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. ```
This commit is contained in:
parent
50091592dd
commit
6d3689fcf6
@ -150,7 +150,9 @@ static void double_lock_detected(const void* mutex, LockStack& lock_stack)
|
|||||||
LogPrintf(" %s\n", i.second.ToString());
|
LogPrintf(" %s\n", i.second.ToString());
|
||||||
}
|
}
|
||||||
if (g_debug_lockorder_abort) {
|
if (g_debug_lockorder_abort) {
|
||||||
tfm::format(std::cerr, "Assertion failed: detected double lock at %s:%i, details in debug log.\n", __FILE__, __LINE__);
|
tfm::format(std::cerr,
|
||||||
|
"Assertion failed: detected double lock for %s, details in debug log.\n",
|
||||||
|
lock_stack.back().second.ToString());
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
throw std::logic_error("double lock detected");
|
throw std::logic_error("double lock detected");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user