From 12690c66d696ca3fc5a83dfd1b6810f84aca217d Mon Sep 17 00:00:00 2001 From: pusheaxpopebx Date: Thu, 23 Sep 2021 01:14:20 +0300 Subject: [PATCH] possible race fix in Worker --- src/backend/common/Worker.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/common/Worker.h b/src/backend/common/Worker.h index f4c12ea52..cc1a0e2ec 100644 --- a/src/backend/common/Worker.h +++ b/src/backend/common/Worker.h @@ -20,6 +20,9 @@ #define XMRIG_WORKER_H +#include + + #include "backend/common/interfaces/IWorker.h" @@ -36,7 +39,7 @@ protected: inline size_t id() const override { return m_id; } inline uint32_t node() const { return m_node; } - uint64_t m_count = 0; + std::atomic m_count = {0}; private: const int64_t m_affinity;