mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
test: Add LockStackEmpty()
This commit is contained in:
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 */
|
||||
|
||||
Reference in New Issue
Block a user