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

Function TestDoubleLock

src/test/sync_tests.cpp:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44template <typename MutexType>
45void TestDoubleLock(bool should_throw)
46{
47 const bool prev = g_debug_lockorder_abort;
48 g_debug_lockorder_abort = false;
49
50 MutexType m;
51 ENTER_CRITICAL_SECTION(m);
52 if (should_throw) {
53 BOOST_CHECK_EXCEPTION(TestDoubleLock2(m), std::logic_error,
54 HasReason("double lock detected"));
55 } else {
56 BOOST_CHECK_NO_THROW(TestDoubleLock2(m));
57 }
58 LEAVE_CRITICAL_SECTION(m);
59
60 BOOST_CHECK(LockStackEmpty());
61
62 g_debug_lockorder_abort = prev;
63}
64#endif /* DEBUG_LOCKORDER */
65
66template <typename MutexType>

Callers

nothing calls this directly

Calls 3

TestDoubleLock2Function · 0.85
HasReasonClass · 0.85
LockStackEmptyFunction · 0.50

Tested by

no test coverage detected