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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user