From 8494e91f2275a70cd0ccf76f629feec055c29e5e Mon Sep 17 00:00:00 2001 From: Guy Kroizman Date: Mon, 2 Mar 2020 22:43:19 +0200 Subject: [PATCH] replace bool with atomic fix usage of bool without sync between threads. --- include/spdlog/details/periodic_worker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/details/periodic_worker.h b/include/spdlog/details/periodic_worker.h index d3b5c639..bdc15bbc 100644 --- a/include/spdlog/details/periodic_worker.h +++ b/include/spdlog/details/periodic_worker.h @@ -27,7 +27,7 @@ public: ~periodic_worker(); private: - bool active_; + std::atomic active_; std::thread worker_thread_; std::mutex mutex_; std::condition_variable cv_;