| 25 | } |
| 26 | |
| 27 | bool 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 | |
| 42 | void worker_thread_executor::wait_for_task(std::unique_lock<std::mutex>& lock) { |
| 43 | assert(lock.owns_lock()); |