diff options
-rw-r--r-- | Environment.hpp | 4 | ||||
-rw-r--r-- | backend/BackendConnector.cpp | 1 | ||||
-rw-r--r-- | cli/cli-miner.cpp | 2 | ||||
-rw-r--r-- | executor.cpp | 2 | ||||
-rw-r--r-- | executor.h | 8 |
5 files changed, 11 insertions, 6 deletions
diff --git a/Environment.hpp b/Environment.hpp index 9f887a1..01090a4 100644 --- a/Environment.hpp +++ b/Environment.hpp @@ -2,6 +2,7 @@ class printer; class jconf; +class executor; namespace xmrstak { @@ -22,6 +23,7 @@ struct Environment this->pPrinter = env.pPrinter; this->pGlobalStates = env.pGlobalStates; this->pJconfConfig = env.pJconfConfig; + this->pExecutor = env.pExecutor; return *this; } @@ -37,6 +39,8 @@ struct Environment jconf* pJconfConfig; + executor* pExecutor; + }; } // namepsace xmrstak diff --git a/backend/BackendConnector.cpp b/backend/BackendConnector.cpp index 194cb5c..0ef69f1 100644 --- a/backend/BackendConnector.cpp +++ b/backend/BackendConnector.cpp @@ -44,6 +44,7 @@ #include "Plugin.hpp" #include "../Environment.hpp" +#include "../console.h" namespace xmrstak { diff --git a/cli/cli-miner.cpp b/cli/cli-miner.cpp index e5c5863..9cd9825 100644 --- a/cli/cli-miner.cpp +++ b/cli/cli-miner.cpp @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) #endif printer::inst()->print_str("-------------------------------------------------------------------\n"); - printer::inst()->print_str( XMR_STAK_NAME" " XMR_STAK_VERSION " mining software, CPU Version.\n"); + printer::inst()->print_str( XMR_STAK_NAME" " XMR_STAK_VERSION " mining software.\n"); printer::inst()->print_str("Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).\n"); #ifndef CONF_NO_CUDA printer::inst()->print_str("NVIDIA mining code was written by KlausT and psychocrypt.\n"); diff --git a/executor.cpp b/executor.cpp index 0dd9cd7..64f3d40 100644 --- a/executor.cpp +++ b/executor.cpp @@ -44,8 +44,6 @@ #define strncasecmp _strnicmp #endif // _WIN32 -executor* executor::oInst = NULL; - executor::executor() { } @@ -7,6 +7,7 @@ #include <future> #include "telemetry.h" #include "backend/IBackend.hpp" +#include "Environment.hpp" class jpsock; @@ -25,8 +26,10 @@ class executor public: static executor* inst() { - if (oInst == nullptr) oInst = new executor; - return oInst; + auto& env = xmrstak::Environment::inst(); + if(env.pExecutor == nullptr) + env.pExecutor = new executor; + return env.pExecutor; }; void ex_start(bool daemon) { daemon ? ex_main() : std::thread(&executor::ex_main, this).detach(); } @@ -73,7 +76,6 @@ private: bool is_dev_time; executor(); - static executor* oInst; void ex_main(); |