From d35ff4eb422ccc2c0fb2875e3b866df93cd4aac3 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Mon, 21 Sep 2020 09:21:06 +0200 Subject: [PATCH] Add a volatile on the stop flag in the thread pool --- src/external/threadpool/ThreadPool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/external/threadpool/ThreadPool.h b/src/external/threadpool/ThreadPool.h index 36169849..2e030687 100644 --- a/src/external/threadpool/ThreadPool.h +++ b/src/external/threadpool/ThreadPool.h @@ -29,7 +29,7 @@ private: // synchronization std::mutex queue_mutex; std::condition_variable condition; - bool stop; + volatile bool stop; }; // the constructor just launches some amount of workers