Disallow the addition of new tasks and wait for all currently running tasks to complete.
| 73 | // Disallow the addition of new tasks and wait for all currently running |
| 74 | // tasks to complete. |
| 75 | PDAL_EXPORT void join() |
| 76 | { |
| 77 | std::unique_lock<std::mutex> lock(m_mutex); |
| 78 | if (!m_running) return; |
| 79 | m_running = false; |
| 80 | lock.unlock(); |
| 81 | |
| 82 | m_consumeCv.notify_all(); |
| 83 | for (auto& t : m_threads) |
| 84 | t.join(); |
| 85 | m_threads.clear(); |
| 86 | } |
| 87 | |
| 88 | // join() and empty the queue of tasks that may have been waiting to run. |
| 89 | PDAL_EXPORT void stop() |
no test coverage detected