fix: reintroduce code that cancels all remaining tasks on task manager shutdown

This commit is contained in:
Sebastian Ullrich 2020-09-14 11:47:00 +02:00
parent 63d60e6564
commit fce8ca304b

View file

@ -807,11 +807,16 @@ public:
}
~task_manager() {
{
unique_lock<mutex> lock(m_mutex);
m_shutting_down = true;
unique_lock<mutex> lock(m_mutex);
for (worker_info * info : m_workers) {
if (info->m_task) {
lean_assert(info->m_task->m_imp);
info->m_task->m_imp->m_canceled = true;
}
}
m_shutting_down = true;
m_queue_cv.notify_all();
lock.unlock();
for (worker_info * w : m_workers) {
w->m_thread->join();
delete w;