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

Method drain_queue_impl

source/executors/worker_thread_executor.cpp:27–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool worker_thread_executor::drain_queue_impl() {
28 while (!m_private_queue.empty()) {
29 auto task = std::move(m_private_queue.front());
30 m_private_queue.pop_front();
31
32 if (m_private_atomic_abort.load(std::memory_order_relaxed)) {
33 return false;
34 }
35
36 task();
37 }
38
39 return true;
40}
41
42void worker_thread_executor::wait_for_task(std::unique_lock<std::mutex>& lock) {
43 assert(lock.owns_lock());

Callers

nothing calls this directly

Calls 3

taskFunction · 0.85
pop_frontMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected