MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / startLoop

Method startLoop

src/ipc/capnp/protocol.cpp:123–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 }
122 Context& context() override { return m_context; }
123 void startLoop(const char* exe_name)
124 {
125 if (m_loop) return;
126 std::promise<void> promise;
127 m_loop_thread = std::thread([&] {
128 util::ThreadRename("capnp-loop");
129 mp::LogOptions opts = {
130 .log_fn = IpcLogFn,
131 .log_level = GetRequestedIPCLogLevel()
132 };
133 m_loop.emplace(exe_name, std::move(opts), &m_context);
134 m_loop_ref.emplace(*m_loop);
135 promise.set_value();
136 m_loop->loop();
137 m_loop.reset();
138 });
139 promise.get_future().wait();
140 }
141 Context m_context;
142 std::thread m_loop_thread;
143 //! EventLoop object which manages I/O events for all connections.

Callers

nothing calls this directly

Calls 5

GetRequestedIPCLogLevelFunction · 0.85
emplaceMethod · 0.80
loopMethod · 0.80
resetMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected