diff --git a/tpool/task_group.cc b/tpool/task_group.cc index d65c658a198..ec9988ded6e 100644 --- a/tpool/task_group.cc +++ b/tpool/task_group.cc @@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ #include #include #include +#include namespace tpool { task_group::task_group(unsigned int max_concurrency) : @@ -78,13 +79,6 @@ namespace tpool task_group::~task_group() { - std::unique_lock lk(m_mtx); - m_queue.clear(); - while (m_tasks_running) - { - lk.unlock(); - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - lk.lock(); - } + assert(m_queue.empty() && !m_tasks_running); } -} \ No newline at end of file +}