From a10e112e6436b30c9eb5ca2a82c94f83205bbc34 Mon Sep 17 00:00:00 2001 From: FernandoS27 Date: Tue, 6 Apr 2021 04:23:02 +0200 Subject: common/thread_worker: Fix data race --- src/common/thread_worker.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common/thread_worker.h') diff --git a/src/common/thread_worker.h b/src/common/thread_worker.h index 7e2b04a07..12bbf5fef 100644 --- a/src/common/thread_worker.h +++ b/src/common/thread_worker.h @@ -11,6 +11,7 @@ #include #include +#include "common/common_types.h" #include "common/unique_function.h" namespace Common { @@ -29,6 +30,10 @@ private: std::condition_variable condition; std::condition_variable wait_condition; std::atomic_bool stop{}; + std::atomic work_scheduled{}; + std::atomic work_done{}; + std::atomic workers_stopped{}; + std::atomic workers_queued{}; }; } // namespace Common -- cgit v1.2.3