ComponentThread: Remove lambdas; use standard async pattern

We've finally cleaned this code up by removing these dirty lambdas.
Next we do the Mind:: class sequences.
This commit is contained in:
2025-09-11 18:41:45 -04:00
parent b8c931397d
commit fb17c51ef6
3 changed files with 278 additions and 119 deletions
+6 -6
View File
@@ -47,7 +47,7 @@ void ComponentThread::marionetteMain(ComponentThread& self)
self.initializeTls();
mrntt::exitCode = EXIT_SUCCESS;
static boost::asio::signal_set signals(self.getIoService(), SIGINT);
bool callFinalizeReq = false, callShutdownSalmanoff = false;
bool callFinalizeReq = false, callShutdownSalmanoffReq = false;
try {
// Register SIGINT (Ctrl+C) and SIGSEGV handlers
@@ -144,7 +144,7 @@ void ComponentThread::marionetteMain(ComponentThread& self)
if (sendExceptionInd)
{
mrntt::exitCode = EXIT_FAILURE;
self.exceptionInd(self);
self.exceptionInd(self.shared_from_this());
}
}
@@ -163,23 +163,23 @@ void ComponentThread::marionetteMain(ComponentThread& self)
}
*out << outUsageMsg << e.what() << std::endl;
callShutdownSalmanoff = callFinalizeReq = true;
callShutdownSalmanoffReq = callFinalizeReq = true;
}
catch (const std::exception& e)
{
std::cerr << __func__ << ": Exception occurred: " << e.what()
<< std::endl;
mrntt::exitCode = EXIT_FAILURE;
callShutdownSalmanoff = callFinalizeReq = true;
callShutdownSalmanoffReq = callFinalizeReq = true;
}
catch (...)
{
std::cerr << __func__ << ": Unknown exception occurred" << std::endl;
mrntt::exitCode = EXIT_FAILURE;
callShutdownSalmanoff = callFinalizeReq = true;
callShutdownSalmanoffReq = callFinalizeReq = true;
}
if (callShutdownSalmanoff)
if (callShutdownSalmanoffReq)
{
shutdownSalmanoff(
[](bool success)