8 #include <boost/test/unit_test.hpp>
11 template <
typename MutexType>
12 void TestPotentialDeadLockDetected(MutexType& mutex1, MutexType& mutex2)
15 LOCK2(mutex1, mutex2);
17 bool error_thrown =
false;
19 LOCK2(mutex2, mutex1);
20 }
catch (
const std::logic_error& e) {
24 #ifdef DEBUG_LOCKORDER
36 #ifdef DEBUG_LOCKORDER
37 bool prev = g_debug_lockorder_abort;
38 g_debug_lockorder_abort =
false;
42 TestPotentialDeadLockDetected(rmutex1, rmutex2);
45 TestPotentialDeadLockDetected(mutex1, mutex2);
47 #ifdef DEBUG_LOCKORDER
48 g_debug_lockorder_abort = prev;
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(potential_deadlock_detected)