MCPcopy Create free account
hub / github.com/PDAL/PDAL / clearTasks

Function clearTasks

pdal/util/ThreadPool.hpp:96–102  ·  view source on GitHub ↗

Empty the queue of tasks that may have been waiting to run.

Source from the content-addressed store, hash-verified

94
95 // Empty the queue of tasks that may have been waiting to run.
96 PDAL_EXPORT void clearTasks()
97 {
98 // Effectively clear the queue.
99 std::lock_guard<std::mutex> lock(m_mutex);
100 std::queue<std::function<void()>> q;
101 m_tasks.swap(q);
102 }
103
104 // Wait for all current tasks to complete. As opposed to join, tasks may
105 // continue to be added while a thread is await()-ing the queue to empty.

Callers 1

stopFunction · 0.85

Calls 1

swapMethod · 0.80

Tested by

no test coverage detected