smo::Mind instance now global; track & manage JOLT state in Mind

We moved the instance of smo::Mind to global scope. I suppose we'll
only support one instance of Mind per SMO process at least for now.

We now track the state of Mind threads' JOLT-waiting. This allows us
to centralize the Mind thread shutdown logic. Mind::finalizeReq()
now takes care of all Mind thread shutdown state logic by tracking
whether Mind threads need to be JOLTed first before being told to
exit.
This commit is contained in:
2025-08-10 13:12:17 -04:00
parent e2e589dc17
commit c457ee7aca
4 changed files with 53 additions and 25 deletions
+5 -4
View File
@@ -1,9 +1,10 @@
#include <unistd.h>
#include <iostream>
#include <componentThread.h>
#include <boost/asio.hpp>
#include <pthread.h>
#include <sched.h>
#include <unistd.h>
#include <boost/asio.hpp>
#include <mind.h>
#include <componentThread.h>
namespace smo {
@@ -377,7 +378,7 @@ void ComponentThread::exceptionInd(ComponentThread& thread)
std::cerr << "Mrntt: Exception occurred: in thread "
<< thread.name << ". Killing Salmanoff." << "\n";
ComponentThread::exitAllMindThreadsReq(
smo::mind.finalizeReq(
[]()
{
mrntt::mrntt->keepLooping = false;