- add excecutor to the singleton export list
This commit is contained in:
psychocrypt
2017-09-30 23:46:08 +02:00
parent b1e92092bb
commit 9e7efd40bc
5 changed files with 11 additions and 6 deletions
+4
View File
@@ -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
+1
View File
@@ -44,6 +44,7 @@
#include "Plugin.hpp"
#include "../Environment.hpp"
#include "../console.h"
namespace xmrstak
{
+1 -1
View File
@@ -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");
-2
View File
@@ -44,8 +44,6 @@
#define strncasecmp _strnicmp
#endif // _WIN32
executor* executor::oInst = NULL;
executor::executor()
{
}
+5 -3
View File
@@ -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();