mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
test: Add LockStackEmpty()
This commit is contained in:
@@ -14,6 +14,7 @@ void TestPotentialDeadLockDetected(MutexType& mutex1, MutexType& mutex2)
|
||||
{
|
||||
LOCK2(mutex1, mutex2);
|
||||
}
|
||||
BOOST_CHECK(LockStackEmpty());
|
||||
bool error_thrown = false;
|
||||
try {
|
||||
LOCK2(mutex2, mutex1);
|
||||
@@ -21,6 +22,7 @@ void TestPotentialDeadLockDetected(MutexType& mutex1, MutexType& mutex2)
|
||||
BOOST_CHECK_EQUAL(e.what(), "potential deadlock detected: mutex1 -> mutex2 -> mutex1");
|
||||
error_thrown = true;
|
||||
}
|
||||
BOOST_CHECK(LockStackEmpty());
|
||||
#ifdef DEBUG_LOCKORDER
|
||||
BOOST_CHECK(error_thrown);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user