| 410 | } |
| 411 | |
| 412 | void thread_pool_worker::enqueue_foreign(concurrencpp::task& task) { |
| 413 | std::unique_lock<std::mutex> lock(m_lock); |
| 414 | if (m_abort) { |
| 415 | throw_runtime_shutdown_exception(m_parent_pool.name); |
| 416 | } |
| 417 | |
| 418 | m_task_found_or_abort.store(true, std::memory_order_relaxed); |
| 419 | |
| 420 | const auto is_empty = m_public_queue.empty(); |
| 421 | m_public_queue.emplace_back(std::move(task)); |
| 422 | ensure_worker_active(is_empty, lock); |
| 423 | } |
| 424 | |
| 425 | void thread_pool_worker::enqueue_foreign(std::span<concurrencpp::task> tasks) { |
| 426 | std::unique_lock<std::mutex> lock(m_lock); |
no test coverage detected