19 tdbg(
"run: entered" << std::endl);
21 std::unique_lock<std::mutex> lock(
m_mutex);
24 while (!
m_cond.wait_for(lock, std::chrono::milliseconds(100), [
this] {
return nullptr !=
m_task ||
m_term; })) {
25 if (++
run >= idle_runs) {
31 tdbg(
"executing task " <<
m_task << std::endl);
33 tdbg(
"done executing task " <<
m_task << std::endl);
41 tdbg(
"run: leaving" << std::endl);
std::atomic< bool > m_term
std::unique_ptr< std::thread > m_thread
std::atomic< bool > m_busy
bool auto_delete() const
Returns true if auto deletion is active.
std::condition_variable m_cond
void finish(worker *worker=nullptr)
Called by a worker when a task has auto_deletion enabled.
static uint32_t m_timeout