mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
test: Add LockStackEmpty()
This commit is contained in:
parent
42b2a95373
commit
63e9e40b73
3 changed files with 21 additions and 6 deletions
11
src/sync.cpp
11
src/sync.cpp
|
|
@ -264,6 +264,17 @@ void DeleteLock(void* cs)
|
|||
}
|
||||
}
|
||||
|
||||
bool LockStackEmpty()
|
||||
{
|
||||
LockData& lockdata = GetLockData();
|
||||
std::lock_guard<std::mutex> lock(lockdata.dd_mutex);
|
||||
const auto it = lockdata.m_lock_stacks.find(std::this_thread::get_id());
|
||||
if (it == lockdata.m_lock_stacks.end()) {
|
||||
return true;
|
||||
}
|
||||
return it->second.empty();
|
||||
}
|
||||
|
||||
bool g_debug_lockorder_abort = true;
|
||||
|
||||
#endif /* DEBUG_LOCKORDER */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue