Moved JOLT state tracking into ComponentThread::

This commit is contained in:
2025-08-10 13:29:34 -04:00
parent 42b32f27e6
commit 099d60bcc4
4 changed files with 11 additions and 9 deletions
+5 -5
View File
@@ -22,9 +22,9 @@ void Mind::initialize()
/* Jolt the threads, then start them */
ComponentThread::joltAllMindThreadsReq(
[this]()
[]()
{
this->threadsHaveBeenJolted = true;
ComponentThread::threadsHaveBeenJolted.store(true);
std::cout << "Mrntt: All mind threads JOLTed." << "\n";
ComponentThread::startAllMindThreadsReq(
[]()
@@ -42,12 +42,12 @@ void Mind::finalizeReq(std::function<void()> callback)
* otherwise they'll just enter their main loops and wait for control
* messages from mrntt after processing the exit request.
*/
if (!threadsHaveBeenJolted)
if (!ComponentThread::threadsHaveBeenJolted.load())
{
ComponentThread::joltAllMindThreadsReq(
[this, callback]()
[callback]()
{
this->threadsHaveBeenJolted = true;
ComponentThread::threadsHaveBeenJolted.store(true);
ComponentThread::exitAllMindThreadsReq(
[callback]()
{