diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-09-27 16:22:34 +0200 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-09-30 23:46:08 +0200 |
commit | b1e92092bb5c93863d869a2d6b6e057918a77b2f (patch) | |
tree | d8a4e434159a12af6542c8302fb26d4860ac2a6d /backend/BackendConnector.cpp | |
parent | ef551cc032716d8cb21ecfdff73bb6c2bc581740 (diff) | |
download | xmr-stak-b1e92092bb5c93863d869a2d6b6e057918a77b2f.zip xmr-stak-b1e92092bb5c93863d869a2d6b6e057918a77b2f.tar.gz |
fix singleton issues on windows
- pass all singletons into the backend libraries
- move some cpu config features from the cpu config file to the global config.txt
- add global jconf to the xported singleton list
Diffstat (limited to 'backend/BackendConnector.cpp')
-rw-r--r-- | backend/BackendConnector.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/backend/BackendConnector.cpp b/backend/BackendConnector.cpp index f1b71b4..194cb5c 100644 --- a/backend/BackendConnector.cpp +++ b/backend/BackendConnector.cpp @@ -43,6 +43,7 @@ #include <cstdlib> #include "Plugin.hpp" +#include "../Environment.hpp" namespace xmrstak { @@ -56,15 +57,15 @@ bool BackendConnector::self_test() std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork) { - GlobalStates::iGlobalJobNo = 0; - GlobalStates::iConsumeCnt = 0; + GlobalStates::inst().iGlobalJobNo = 0; + GlobalStates::inst().iConsumeCnt = 0; std::vector<IBackend*>* pvThreads = new std::vector<IBackend*>; #ifndef CONF_NO_CUDA Plugin nvidiaPlugin("NVIDIA", "xmrstak_cuda_backend"); - std::vector<IBackend*>* nvidiaThreads = nvidiaPlugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork); + std::vector<IBackend*>* nvidiaThreads = nvidiaPlugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork, Environment::inst()); pvThreads->insert(std::end(*pvThreads), std::begin(*nvidiaThreads), std::end(*nvidiaThreads)); if(nvidiaThreads->size() == 0) printer::inst()->print_msg(L0, "WARNING: backend NVIDIA disabled."); @@ -72,7 +73,7 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork) #ifndef CONF_NO_OPENCL Plugin amdPlugin("AMD", "xmrstak_opencl_backend"); - std::vector<IBackend*>* amdThreads = amdPlugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork); + std::vector<IBackend*>* amdThreads = amdPlugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork, Environment::inst()); pvThreads->insert(std::end(*pvThreads), std::begin(*amdThreads), std::end(*amdThreads)); if(amdThreads->size() == 0) printer::inst()->print_msg(L0, "WARNING: backend AMD disabled."); @@ -85,7 +86,7 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork) printer::inst()->print_msg(L0, "WARNING: backend CPU disabled."); #endif - GlobalStates::iThreadCount = pvThreads->size(); + GlobalStates::inst().iThreadCount = pvThreads->size(); return pvThreads; } |