PuppetApp: Lifetime mgmt ops are now Viral

They no longer accept an exc_ptr and lambda for cb.
This commit is contained in:
2026-05-24 16:11:08 -04:00
parent 16e0350245
commit a14d622eaf
2 changed files with 10 additions and 32 deletions
+5 -14
View File
@@ -2,8 +2,6 @@
#define PUPPET_APPLICATION_H
#include <config.h>
#include <exception>
#include <functional>
#include <memory>
#include <string_view>
#include <vector>
@@ -22,16 +20,11 @@ public:
const std::vector<std::shared_ptr<PuppetThread>> &threads);
~PuppetApplication() = default;
co::ViralNonPostingInvoker<void> joltAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback);
co::ViralNonPostingInvoker<void> startAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback);
co::ViralNonPostingInvoker<void> pauseAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback);
co::ViralNonPostingInvoker<void> resumeAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback);
co::ViralNonPostingInvoker<void> exitAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback);
co::ViralNonPostingInvoker<void> joltAllPuppetThreadsCReq();
co::ViralNonPostingInvoker<void> startAllPuppetThreadsCReq();
co::ViralNonPostingInvoker<void> pauseAllPuppetThreadsCReq();
co::ViralNonPostingInvoker<void> resumeAllPuppetThreadsCReq();
co::ViralNonPostingInvoker<void> exitAllPuppetThreadsCReq();
// CPU distribution method
void distributeAndPinThreadsAcrossCpus();
@@ -71,8 +64,6 @@ protected:
private:
co::ViralNonPostingInvoker<void> allPuppetThreadsLifetimeOpCReq(
std::exception_ptr &exceptionPtr,
std::function<void()> callback,
PuppetThread::ThreadOp threadOp,
std::string_view emptyThreadsLogMessage);
};
+5 -18
View File
@@ -63,9 +63,7 @@ void PuppetApplication::addAllPuppetLifetimeInvokersToGroup(
}
co::ViralNonPostingInvoker<void>
PuppetApplication::joltAllPuppetThreadsCReq(
[[maybe_unused]] std::exception_ptr &exceptionPtr,
[[maybe_unused]] std::function<void()> callback)
PuppetApplication::joltAllPuppetThreadsCReq()
{
if (threadsHaveBeenJolted)
{
@@ -94,8 +92,6 @@ PuppetApplication::joltAllPuppetThreadsCReq(
co::ViralNonPostingInvoker<void>
PuppetApplication::allPuppetThreadsLifetimeOpCReq(
[[maybe_unused]] std::exception_ptr &exceptionPtr,
[[maybe_unused]] std::function<void()> callback,
PuppetThread::ThreadOp threadOp,
std::string_view emptyThreadsLogMessage)
{
@@ -116,39 +112,31 @@ PuppetApplication::allPuppetThreadsLifetimeOpCReq(
}
co::ViralNonPostingInvoker<void>
PuppetApplication::startAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback)
PuppetApplication::startAllPuppetThreadsCReq()
{
return allPuppetThreadsLifetimeOpCReq(
exceptionPtr, std::move(callback),
PuppetThread::ThreadOp::START,
noPuppetThreadsToStartLogMessage);
}
co::ViralNonPostingInvoker<void>
PuppetApplication::pauseAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback)
PuppetApplication::pauseAllPuppetThreadsCReq()
{
return allPuppetThreadsLifetimeOpCReq(
exceptionPtr, std::move(callback),
PuppetThread::ThreadOp::PAUSE,
noPuppetThreadsToPauseLogMessage);
}
co::ViralNonPostingInvoker<void>
PuppetApplication::resumeAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr, std::function<void()> callback)
PuppetApplication::resumeAllPuppetThreadsCReq()
{
return allPuppetThreadsLifetimeOpCReq(
exceptionPtr, std::move(callback),
PuppetThread::ThreadOp::RESUME,
noPuppetThreadsToResumeLogMessage);
}
co::ViralNonPostingInvoker<void>
PuppetApplication::exitAllPuppetThreadsCReq(
std::exception_ptr &exceptionPtr,
std::function<void()> callback)
PuppetApplication::exitAllPuppetThreadsCReq()
{
if (componentThreads.empty())
{
@@ -157,7 +145,6 @@ PuppetApplication::exitAllPuppetThreadsCReq(
}
co_await allPuppetThreadsLifetimeOpCReq(
exceptionPtr, std::move(callback),
PuppetThread::ThreadOp::EXIT,
noPuppetThreadsToExitLogMessage);