mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add unit test for DEBUG_LOCKORDER code
This commit is contained in:
parent
2b67354aa5
commit
41b88e9337
4 changed files with 56 additions and 1 deletions
|
|
@ -100,7 +100,11 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch,
|
|||
}
|
||||
LogPrintf(" %s\n", i.second.ToString());
|
||||
}
|
||||
assert(false);
|
||||
if (g_debug_lockorder_abort) {
|
||||
fprintf(stderr, "Assertion failed: detected inconsistent lock order at %s:%i, details in debug log.\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
throw std::logic_error("potential deadlock detected");
|
||||
}
|
||||
|
||||
static void push_lock(void* c, const CLockLocation& locklocation)
|
||||
|
|
@ -189,4 +193,6 @@ void DeleteLock(void* cs)
|
|||
}
|
||||
}
|
||||
|
||||
bool g_debug_lockorder_abort = true;
|
||||
|
||||
#endif /* DEBUG_LOCKORDER */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue