diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-11-26 14:16:10 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2020-11-26 14:41:53 +0100 |
commit | 6d3689fcf6cff397187028344570489db3e6ecf4 (patch) | |
tree | 25c5bb1089d173663f0f76f8480c3e2121979c5f /src/sync.cpp | |
parent | 50091592dd875a1c94030dbed74112b003732d68 (diff) |
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.
```
Diffstat (limited to 'src/sync.cpp')
-rw-r--r-- | src/sync.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sync.cpp b/src/sync.cpp index 2e431720e6..2160940952 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -150,7 +150,9 @@ static void double_lock_detected(const void* mutex, LockStack& lock_stack) LogPrintf(" %s\n", i.second.ToString()); } 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(); } throw std::logic_error("double lock detected"); |