mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Compilation fixups
This commit is contained in:
@@ -169,18 +169,19 @@ 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),
|
||||||
|
selfPtr(_selfPtr),
|
||||||
|
lifetimeMgmtCallback{
|
||||||
|
nullptr,
|
||||||
|
[this]()
|
||||||
|
{
|
||||||
|
settled = true;
|
||||||
|
if (callerSchedHandle) {
|
||||||
|
callerSchedHandle.resume();
|
||||||
|
}
|
||||||
|
}}
|
||||||
{
|
{
|
||||||
cps::Callback<threadLifetimeMgmtOpCbFn> callback{
|
|
||||||
nullptr,
|
|
||||||
[this]()
|
|
||||||
{
|
|
||||||
settled = true;
|
|
||||||
if (callerSchedHandle) {
|
|
||||||
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,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
|
||||||
|
|||||||
Reference in New Issue
Block a user