MCPcopy Create free account
hub / github.com/ElementsProject/elements / TestInconsistentLockOrderDetected

Function TestInconsistentLockOrderDetected

src/test/sync_tests.cpp:67–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66template <typename MutexType>
67void TestInconsistentLockOrderDetected(MutexType& mutex1, MutexType& mutex2) NO_THREAD_SAFETY_ANALYSIS
68{
69 ENTER_CRITICAL_SECTION(mutex1);
70 ENTER_CRITICAL_SECTION(mutex2);
71#ifdef DEBUG_LOCKORDER
72 BOOST_CHECK_EXCEPTION(LEAVE_CRITICAL_SECTION(mutex1), std::logic_error, HasReason("mutex1 was not most recent critical section locked"));
73#endif // DEBUG_LOCKORDER
74 LEAVE_CRITICAL_SECTION(mutex2);
75 LEAVE_CRITICAL_SECTION(mutex1);
76 BOOST_CHECK(LockStackEmpty());
77}
78} // namespace
79
80BOOST_AUTO_TEST_SUITE(sync_tests)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

HasReasonClass · 0.85
LockStackEmptyFunction · 0.50

Tested by

no test coverage detected