diff --git a/ThreadPool.h b/ThreadPool.h index bf639a3..0235c8b 100644 --- a/ThreadPool.h +++ b/ThreadPool.h @@ -38,7 +38,7 @@ inline ThreadPool::ThreadPool(size_t threads) workers.emplace_back( [this] { - while(true) + for(;;) { std::unique_lock lock(this->queue_mutex); while(!this->stop && this->tasks.empty())