From 694dd354615457ba92cfa34c2ec2a3aaf30a140d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Jan 2014 17:14:12 +0100 Subject: [PATCH] Fix MSVS 2013 warning about a condition being always true. Use "for(;;)" for the infinite loop to avoid the warning at /W4 warning level. --- ThreadPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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())