diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2017-10-17 20:14:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-17 20:14:45 +0100 |
commit | c7c5824364109139bd545e28c2d744399edae869 (patch) | |
tree | e8bdc11fd7cf9a2ae6343c14549a22f2205d380d /xmrstak/backend/cpu/minethd.hpp | |
parent | dcd176ada4ed631b0ea2b2762d93d9be3e4307d4 (diff) | |
parent | 4253e7a0289bcaed1ecab7616f3405dfebb190e4 (diff) | |
download | xmr-stak-c7c5824364109139bd545e28c2d744399edae869.zip xmr-stak-c7c5824364109139bd545e28c2d744399edae869.tar.gz |
Merge pull request #43 from fireice-uk/fix-aff-alt-c
Affinity fix version C
Diffstat (limited to 'xmrstak/backend/cpu/minethd.hpp')
-rw-r--r-- | xmrstak/backend/cpu/minethd.hpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmrstak/backend/cpu/minethd.hpp b/xmrstak/backend/cpu/minethd.hpp index 58d378e..5ffd44e 100644 --- a/xmrstak/backend/cpu/minethd.hpp +++ b/xmrstak/backend/cpu/minethd.hpp @@ -8,7 +8,7 @@ #include <thread> #include <vector> #include <atomic> -#include <mutex> +#include <future> namespace xmrstak { @@ -24,7 +24,7 @@ public: typedef void (*cn_hash_fun)(const void*, size_t, void*, cryptonight_ctx*); static cn_hash_fun func_selector(bool bHaveAes, bool bNoPrefetch); - static void thd_setaffinity(std::thread::native_handle_type h, uint64_t cpu_id); + static bool thd_setaffinity(std::thread::native_handle_type h, uint64_t cpu_id); static cryptonight_ctx* minethd_alloc_ctx(); @@ -45,9 +45,7 @@ private: static miner_work oGlobalWork; miner_work oWork; - void pin_thd_affinity(); - // Held by the creating context to prevent a race cond with oWorkThd = std::thread(...) - std::mutex work_thd_mtx; + std::promise<void> order_fix; std::thread oWorkThd; int64_t affinity; |