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

Function double_lock_detected

src/sync.cpp:131–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static void double_lock_detected(const void* mutex, const LockStack& lock_stack)
132{
133 LogPrintf("DOUBLE LOCK DETECTED\n");
134 LogPrintf("Lock order:\n");
135 for (const LockStackItem& i : lock_stack) {
136 std::string prefix{};
137 if (i.first == mutex) {
138 prefix = " (*)";
139 }
140 LogPrintf("%s %s\n", prefix, i.second.ToString());
141 }
142 if (g_debug_lockorder_abort) {
143 tfm::format(std::cerr,
144 "Assertion failed: detected double lock for %s, details in debug log.\n",
145 lock_stack.back().second.ToString());
146 abort();
147 }
148 throw std::logic_error("double lock detected");
149}
150
151template <typename MutexType>
152static void push_lock(MutexType* c, const CLockLocation& locklocation)

Callers 1

push_lockFunction · 0.85

Calls 2

formatFunction · 0.70
ToStringMethod · 0.45

Tested by

no test coverage detected