Compilation fixups

This commit is contained in:
2026-05-19 10:06:23 -04:00
parent 3f91cbf104
commit 525530b567
2 changed files with 24 additions and 21 deletions
+12 -10
View File
@@ -169,9 +169,10 @@ public:
ThreadOp _threadOp, ThreadOp _threadOp,
PuppetThread &_parentThread, PuppetThread &_parentThread,
const std::shared_ptr<PuppetThread> &_selfPtr = nullptr) const std::shared_ptr<PuppetThread> &_selfPtr = nullptr)
: threadOp(_threadOp), parentThread(_parentThread), selfPtr(_selfPtr) : threadOp(_threadOp),
{ parentThread(_parentThread),
cps::Callback<threadLifetimeMgmtOpCbFn> callback{ selfPtr(_selfPtr),
lifetimeMgmtCallback{
nullptr, nullptr,
[this]() [this]()
{ {
@@ -179,8 +180,8 @@ public:
if (callerSchedHandle) { if (callerSchedHandle) {
callerSchedHandle.resume(); callerSchedHandle.resume();
} }
}}; }}
{
if (threadOp == ThreadOp::JOLT && selfPtr == nullptr) if (threadOp == ThreadOp::JOLT && selfPtr == nullptr)
{ {
throw std::runtime_error(std::string(__func__) throw std::runtime_error(std::string(__func__)
@@ -190,19 +191,19 @@ public:
switch (threadOp) switch (threadOp)
{ {
case ThreadOp::START: case ThreadOp::START:
parentThread.startThreadReq(callback); parentThread.startThreadReq(lifetimeMgmtCallback);
break; break;
case ThreadOp::PAUSE: case ThreadOp::PAUSE:
parentThread.pauseThreadReq(callback); parentThread.pauseThreadReq(lifetimeMgmtCallback);
break; break;
case ThreadOp::RESUME: case ThreadOp::RESUME:
parentThread.resumeThreadReq(callback); parentThread.resumeThreadReq(lifetimeMgmtCallback);
break; break;
case ThreadOp::EXIT: case ThreadOp::EXIT:
parentThread.exitThreadReq(callback); parentThread.exitThreadReq(lifetimeMgmtCallback);
break; break;
case ThreadOp::JOLT: case ThreadOp::JOLT:
parentThread.joltThreadReq(selfPtr, callback); parentThread.joltThreadReq(selfPtr, lifetimeMgmtCallback);
break; break;
default: default:
@@ -228,6 +229,7 @@ public:
std::coroutine_handle<> callerSchedHandle; std::coroutine_handle<> callerSchedHandle;
PuppetThread &parentThread; PuppetThread &parentThread;
const std::shared_ptr<PuppetThread> selfPtr; const std::shared_ptr<PuppetThread> selfPtr;
cps::Callback<threadLifetimeMgmtOpCbFn> lifetimeMgmtCallback;
}; };
ViralThreadLifetimeMgmtInvoker startThreadAReq() ViralThreadLifetimeMgmtInvoker startThreadAReq()
+6 -5
View File
@@ -6,6 +6,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <spinscale/cps/callback.h> #include <spinscale/cps/callback.h>
#include <spinscale/co/invokers.h>
#include <spinscale/componentThread.h> #include <spinscale/componentThread.h>
namespace sscl { namespace sscl {
@@ -20,15 +21,15 @@ public:
// Thread management methods // Thread management methods
typedef std::function<void()> puppetThreadLifetimeMgmtOpCbFn; typedef std::function<void()> puppetThreadLifetimeMgmtOpCbFn;
void joltAllPuppetThreadsCReq( NonViralNonPostingInvoker joltAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback); cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void startAllPuppetThreadsCReq( NonViralNonPostingInvoker startAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback); cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void pauseAllPuppetThreadsCReq( NonViralNonPostingInvoker pauseAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback); cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void resumeAllPuppetThreadsCReq( NonViralNonPostingInvoker resumeAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback); cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void exitAllPuppetThreadsCReq( NonViralNonPostingInvoker exitAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback); cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
// CPU distribution method // CPU distribution method