summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'xmrstak/backend/cpu')
-rw-r--r--xmrstak/backend/cpu/minethd.cpp7
-rw-r--r--xmrstak/backend/cpu/minethd.hpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/xmrstak/backend/cpu/minethd.cpp b/xmrstak/backend/cpu/minethd.cpp
index 8b913cf..8183adf 100644
--- a/xmrstak/backend/cpu/minethd.cpp
+++ b/xmrstak/backend/cpu/minethd.cpp
@@ -102,6 +102,7 @@ minethd::minethd(miner_work& pWork, size_t iNo, bool double_work, bool no_prefet
bNoPrefetch = no_prefetch;
this->affinity = affinity;
+ std::unique_lock<std::mutex> lck(thd_aff_set);
std::future<void> order_guard = order_fix.get_future();
if(double_work)
@@ -340,6 +341,9 @@ void minethd::work_main()
bindMemoryToNUMANode(affinity);
order_fix.set_value();
+ std::unique_lock<std::mutex> lck(thd_aff_set);
+ lck.release();
+ std::this_thread::yield();
cn_hash_fun hash_fun;
cryptonight_ctx* ctx;
@@ -467,6 +471,9 @@ void minethd::double_work_main()
bindMemoryToNUMANode(affinity);
order_fix.set_value();
+ std::unique_lock<std::mutex> lck(thd_aff_set);
+ lck.release();
+ std::this_thread::yield();
cn_hash_fun_dbl hash_fun;
cryptonight_ctx* ctx0;
diff --git a/xmrstak/backend/cpu/minethd.hpp b/xmrstak/backend/cpu/minethd.hpp
index 670ec8d..5520d9e 100644
--- a/xmrstak/backend/cpu/minethd.hpp
+++ b/xmrstak/backend/cpu/minethd.hpp
@@ -46,6 +46,7 @@ private:
miner_work oWork;
std::promise<void> order_fix;
+ std::mutex thd_aff_set;
std::thread oWorkThd;
int64_t affinity;
OpenPOWER on IntegriCloud