MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / shutdown

Method shutdown

source/executors/manual_executor.cpp:220–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void manual_executor::shutdown() {
221 const auto abort = m_atomic_abort.exchange(true, std::memory_order_relaxed);
222 if (abort) {
223 return; // shutdown had been called before.
224 }
225
226 decltype(m_tasks) tasks;
227
228 {
229 std::unique_lock<decltype(m_lock)> lock(m_lock);
230 m_abort = true;
231 tasks = std::move(m_tasks);
232 }
233
234 m_condition.notify_all();
235
236 tasks.clear();
237}
238
239bool manual_executor::shutdown_requested() const {
240 return m_atomic_abort.load(std::memory_order_relaxed);

Callers

nothing calls this directly

Calls 2

notify_allMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected