Libspinscale: begin splitting it off

This commit is contained in:
2025-12-26 01:18:39 -04:00
parent d5c2b61d4c
commit 45959f9d1c
67 changed files with 776 additions and 615 deletions
+17 -13
View File
@@ -1,11 +1,11 @@
#include <iostream>
#include <opts.h>
#include <asynchronousContinuation.h>
#include <asynchronousLoop.h>
#include <callback.h>
#include <callableTracer.h>
#include <spinscale/asynchronousContinuation.h>
#include <spinscale/asynchronousLoop.h>
#include <spinscale/callback.h>
#include <spinscale/callableTracer.h>
#include <mind.h>
#include <componentThread.h>
#include <mindThread.h>
#include <director/director.h>
#include <simulator/simulator.h>
#include <stimBuffApis/stimBuffApiManager.h>
@@ -15,12 +15,12 @@ namespace smo {
Mind::Mind(void)
: componentThreads{
std::make_shared<MindThread>(ComponentThread::DIRECTOR, *this),
std::make_shared<MindThread>(ComponentThread::SIMULATOR, *this),
std::make_shared<MindThread>(ComponentThread::SUBCONSCIOUS, *this),
std::make_shared<MindThread>(ComponentThread::BODY, *this)
std::make_shared<MindThread>(SmoThreadId::DIRECTOR, *this),
std::make_shared<MindThread>(SmoThreadId::SIMULATOR, *this),
std::make_shared<MindThread>(SmoThreadId::SUBCONSCIOUS, *this),
std::make_shared<MindThread>(SmoThreadId::BODY, *this)
#ifndef CONFIG_WORLD_USE_BODY_THREAD
, std::make_shared<MindThread>(ComponentThread::WORLD, *this)
, std::make_shared<MindThread>(SmoThreadId::WORLD, *this)
#endif
},
director(*this, componentThreads[0]),
@@ -38,9 +38,9 @@ Mind::Mind(void)
}
std::shared_ptr<MindThread>
Mind::getComponentThread(ComponentThread::ThreadId id) const
Mind::getComponentThread(ThreadId id) const
{
if (id == ComponentThread::MRNTT)
if (id == SmoThreadId::MRNTT)
{
throw std::runtime_error(
std::string(__func__) +
@@ -339,7 +339,11 @@ void Mind::joltAllMindThreadsReq(
for (auto& thread : componentThreads)
{
thread->joltThreadReq(
std::shared_ptr<PuppetThread> puppetThread =
std::static_pointer_cast<PuppetThread>(thread);
thread->joltThreadReq(
puppetThread,
{request, std::bind(
&MindThreadLifetimeMgmtOp::joltAllMindThreadsReq1,
request.get(), request)});