summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-11-15 15:34:21 +0000
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-15 16:34:21 +0100
commit117493dc5359572a171c7ffb9b55da6740593089 (patch)
treeeae5efff99a00138043680408edacd2397c1e86d /xmrstak/backend/cpu
parent288363814fb091ccfc452f0408bfa53727fc30c0 (diff)
downloadxmr-stak-117493dc5359572a171c7ffb9b55da6740593089.zip
xmr-stak-117493dc5359572a171c7ffb9b55da6740593089.tar.gz
Fix misc bugs (#117)
* CONF_NO_TLS fix * gpu error fix + always return to sched after pin
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