Update: rename mrntt=>pptr
This commit is contained in:
+17
-18
@@ -14,13 +14,11 @@
|
||||
#include <mindManager/mindManager.h>
|
||||
#include <salmanoff.h>
|
||||
|
||||
// Define the global marionette thread instance (declared extern in libspinscale)
|
||||
// Define the global puppeteer thread instance (declared extern in libspinscale)
|
||||
namespace sscl {
|
||||
namespace mrntt {
|
||||
std::shared_ptr<MarionetteThread> thread = std::make_shared<MarionetteThread>();
|
||||
} // namespace mrntt
|
||||
namespace pptr {
|
||||
|
||||
namespace mrntt {
|
||||
std::shared_ptr<PuppeteerThread> thread = std::make_shared<PuppeteerThread>();
|
||||
std::atomic<int> exitCode;
|
||||
MarionetteComponent mrntt(std::static_pointer_cast<sscl::ComponentThread>(thread));
|
||||
|
||||
@@ -41,7 +39,8 @@ void marionetteFinalizeReqCb(bool success)
|
||||
std::cout << __func__ << ": Marionette finalized." << '\n';
|
||||
exitMarionetteLoop();
|
||||
}
|
||||
} // namespace mrntt
|
||||
|
||||
} // namespace pptr
|
||||
} // namespace sscl
|
||||
|
||||
namespace smo {
|
||||
@@ -57,8 +56,8 @@ void marionetteInitializeReqCb(bool success)
|
||||
std::cerr << __func__ << ": Failed to initialize Marionette. Shutting down."
|
||||
<< '\n';
|
||||
|
||||
sscl::mrntt::mrntt.finalizeReq({nullptr, std::bind(
|
||||
&sscl::mrntt::marionetteFinalizeReqCb,
|
||||
sscl::pptr::mrntt.finalizeReq({nullptr, std::bind(
|
||||
&sscl::pptr::marionetteFinalizeReqCb,
|
||||
std::placeholders::_1)});
|
||||
}
|
||||
|
||||
@@ -66,7 +65,7 @@ void marionetteInitializeReqCb(bool success)
|
||||
|
||||
namespace sscl {
|
||||
|
||||
void MarionetteThread::main(MarionetteThread& self)
|
||||
void PuppeteerThread::main(PuppeteerThread& self)
|
||||
{
|
||||
std::string threadName = "smo:" + self.name;
|
||||
pthread_setname_np(pthread_self(), threadName.c_str());
|
||||
@@ -74,7 +73,7 @@ void MarionetteThread::main(MarionetteThread& self)
|
||||
std::cout << __func__ << ": Waiting for command line JOLT" << std::endl;
|
||||
self.getIoService().run();
|
||||
self.initializeTls();
|
||||
sscl::mrntt::exitCode = EXIT_SUCCESS;
|
||||
sscl::pptr::exitCode = EXIT_SUCCESS;
|
||||
static boost::asio::signal_set signals(self.getIoService(), SIGINT);
|
||||
bool callShutdownSalmanoff = false;
|
||||
|
||||
@@ -96,8 +95,8 @@ void MarionetteThread::main(MarionetteThread& self)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sscl::mrntt::mrntt.finalizeReq({nullptr, std::bind(
|
||||
&sscl::mrntt::marionetteFinalizeReqCb,
|
||||
sscl::pptr::mrntt.finalizeReq({nullptr, std::bind(
|
||||
&sscl::pptr::marionetteFinalizeReqCb,
|
||||
std::placeholders::_1)});
|
||||
}
|
||||
);
|
||||
@@ -140,7 +139,7 @@ void MarionetteThread::main(MarionetteThread& self)
|
||||
callShutdownSalmanoff = true;
|
||||
|
||||
// Create new Mind instance just before initializeReq
|
||||
sscl::mrntt::mrntt.initializeReq({nullptr, std::bind(
|
||||
sscl::pptr::mrntt.initializeReq({nullptr, std::bind(
|
||||
&smo::marionetteInitializeReqCb, std::placeholders::_1)});
|
||||
|
||||
std::cout << __func__ << ": Entering event loop" << "\n";
|
||||
@@ -184,8 +183,8 @@ void MarionetteThread::main(MarionetteThread& self)
|
||||
|
||||
if (sendExceptionInd)
|
||||
{
|
||||
sscl::mrntt::exitCode = EXIT_FAILURE;
|
||||
sscl::mrntt::mrntt.exceptionInd();
|
||||
sscl::pptr::exitCode = EXIT_FAILURE;
|
||||
sscl::pptr::mrntt.exceptionInd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +197,7 @@ void MarionetteThread::main(MarionetteThread& self)
|
||||
|
||||
if (typeid(e) == typeid(OptionsParserError))
|
||||
{
|
||||
sscl::mrntt::exitCode = EXIT_FAILURE;
|
||||
sscl::pptr::exitCode = EXIT_FAILURE;
|
||||
out = &std::cerr;
|
||||
outUsageMsg = std::string(__func__) + ": ";
|
||||
}
|
||||
@@ -209,12 +208,12 @@ void MarionetteThread::main(MarionetteThread& self)
|
||||
{
|
||||
std::cerr << __func__ << ": Exception occurred: " << e.what()
|
||||
<< std::endl;
|
||||
sscl::mrntt::exitCode = EXIT_FAILURE;
|
||||
sscl::pptr::exitCode = EXIT_FAILURE;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << __func__ << ": Unknown exception occurred" << std::endl;
|
||||
sscl::mrntt::exitCode = EXIT_FAILURE;
|
||||
sscl::pptr::exitCode = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (callShutdownSalmanoff) {
|
||||
|
||||
Reference in New Issue
Block a user