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,
PuppetThread &_parentThread,
const std::shared_ptr<PuppetThread> &_selfPtr = nullptr)
: threadOp(_threadOp), parentThread(_parentThread), selfPtr(_selfPtr)
{
cps::Callback<threadLifetimeMgmtOpCbFn> callback{
: threadOp(_threadOp),
parentThread(_parentThread),
selfPtr(_selfPtr),
lifetimeMgmtCallback{
nullptr,
[this]()
{
@@ -179,8 +180,8 @@ public:
if (callerSchedHandle) {
callerSchedHandle.resume();
}
}};
}}
{
if (threadOp == ThreadOp::JOLT && selfPtr == nullptr)
{
throw std::runtime_error(std::string(__func__)
@@ -190,19 +191,19 @@ public:
switch (threadOp)
{
case ThreadOp::START:
parentThread.startThreadReq(callback);
parentThread.startThreadReq(lifetimeMgmtCallback);
break;
case ThreadOp::PAUSE:
parentThread.pauseThreadReq(callback);
parentThread.pauseThreadReq(lifetimeMgmtCallback);
break;
case ThreadOp::RESUME:
parentThread.resumeThreadReq(callback);
parentThread.resumeThreadReq(lifetimeMgmtCallback);
break;
case ThreadOp::EXIT:
parentThread.exitThreadReq(callback);
parentThread.exitThreadReq(lifetimeMgmtCallback);
break;
case ThreadOp::JOLT:
parentThread.joltThreadReq(selfPtr, callback);
parentThread.joltThreadReq(selfPtr, lifetimeMgmtCallback);
break;
default:
@@ -228,6 +229,7 @@ public:
std::coroutine_handle<> callerSchedHandle;
PuppetThread &parentThread;
const std::shared_ptr<PuppetThread> selfPtr;
cps::Callback<threadLifetimeMgmtOpCbFn> lifetimeMgmtCallback;
};
ViralThreadLifetimeMgmtInvoker startThreadAReq()
+6 -5
View File
@@ -6,6 +6,7 @@
#include <memory>
#include <vector>
#include <spinscale/cps/callback.h>
#include <spinscale/co/invokers.h>
#include <spinscale/componentThread.h>
namespace sscl {
@@ -20,15 +21,15 @@ public:
// Thread management methods
typedef std::function<void()> puppetThreadLifetimeMgmtOpCbFn;
void joltAllPuppetThreadsCReq(
NonViralNonPostingInvoker joltAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void startAllPuppetThreadsCReq(
NonViralNonPostingInvoker startAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void pauseAllPuppetThreadsCReq(
NonViralNonPostingInvoker pauseAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void resumeAllPuppetThreadsCReq(
NonViralNonPostingInvoker resumeAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
void exitAllPuppetThreadsCReq(
NonViralNonPostingInvoker exitAllPuppetThreadsCReq(
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
// CPU distribution method