| 80 | BOOST_AUTO_TEST_SUITE(sync_tests) |
| 81 | |
| 82 | BOOST_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 |
nothing calls this directly
no test coverage detected