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

Function BOOST_AUTO_TEST_CASE

src/test/sync_tests.cpp:82–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80BOOST_AUTO_TEST_SUITE(sync_tests)
81
82BOOST_AUTO_TEST_CASE(potential_deadlock_detected)
83{
84 #ifdef DEBUG_LOCKORDER
85 bool prev = g_debug_lockorder_abort;
86 g_debug_lockorder_abort = false;
87 #endif
88
89 RecursiveMutex rmutex1, rmutex2;
90 TestPotentialDeadLockDetected(rmutex1, rmutex2);
91 // The second test ensures that lock tracking data have not been broken by exception.
92 TestPotentialDeadLockDetected(rmutex1, rmutex2);
93
94 Mutex mutex1, mutex2;
95 TestPotentialDeadLockDetected(mutex1, mutex2);
96 // The second test ensures that lock tracking data have not been broken by exception.
97 TestPotentialDeadLockDetected(mutex1, mutex2);
98
99 #ifdef DEBUG_LOCKORDER
100 g_debug_lockorder_abort = prev;
101 #endif
102}
103
104/* Double lock would produce an undefined behavior. Thus, we only do that if
105 * DEBUG_LOCKORDER is activated to detect it. We don't want non-DEBUG_LOCKORDER

Callers

nothing calls this directly

Tested by

no test coverage detected