mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Compare commits
4 Commits
1db3494d26
...
3f91cbf104
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f91cbf104 | |||
| 6396cce7e0 | |||
| 15295ac05e | |||
| dc58e5d521 |
@@ -471,7 +471,7 @@ struct Group
|
|||||||
std::size_t settlementIndex) noexcept
|
std::size_t settlementIndex) noexcept
|
||||||
{
|
{
|
||||||
/** EXPLANATION:
|
/** EXPLANATION:
|
||||||
* It's very convenient that our design for the NonViralNonSuspendingInvoker
|
* It's very convenient that our design for the NonViralPostingInvoker
|
||||||
* coincidentally allows us to supply a lambda that can be used to test
|
* coincidentally allows us to supply a lambda that can be used to test
|
||||||
* for the settlement conditions that are being waited on by the Group's
|
* for the settlement conditions that are being waited on by the Group's
|
||||||
* co_awaiter.
|
* co_awaiter.
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include <spinscale/co/nonPostingInvoker.h>
|
||||||
#include <spinscale/co/postingInvoker.h>
|
#include <spinscale/co/postingInvoker.h>
|
||||||
|
|
||||||
namespace sscl::co {
|
namespace sscl::co {
|
||||||
@@ -21,7 +22,7 @@ namespace sscl::co {
|
|||||||
* from get_return_object(). ~PostingInvoker destroys the callee frame.
|
* from get_return_object(). ~PostingInvoker destroys the callee frame.
|
||||||
*/
|
*/
|
||||||
template <template <typename> class PostingPromiseTemplate>
|
template <template <typename> class PostingPromiseTemplate>
|
||||||
struct NonViralNonSuspendingInvoker
|
struct NonViralPostingInvoker
|
||||||
: public PostingInvoker<PostingPromiseTemplate<void>, void>
|
: public PostingInvoker<PostingPromiseTemplate<void>, void>
|
||||||
{
|
{
|
||||||
struct promise_type
|
struct promise_type
|
||||||
@@ -29,10 +30,10 @@ struct NonViralNonSuspendingInvoker
|
|||||||
{
|
{
|
||||||
using PostingPromiseTemplate<void>::PostingPromiseTemplate;
|
using PostingPromiseTemplate<void>::PostingPromiseTemplate;
|
||||||
|
|
||||||
NonViralNonSuspendingInvoker<PostingPromiseTemplate> get_return_object()
|
NonViralPostingInvoker<PostingPromiseTemplate> get_return_object()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning NonViralNonSuspendingInvoker.\n";
|
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning NonViralPostingInvoker.\n";
|
||||||
#endif
|
#endif
|
||||||
if (!this->callerLambda)
|
if (!this->callerLambda)
|
||||||
{
|
{
|
||||||
@@ -53,7 +54,7 @@ struct NonViralNonSuspendingInvoker
|
|||||||
this->setSelfSchedHandle(
|
this->setSelfSchedHandle(
|
||||||
std::coroutine_handle<promise_type>::from_promise(*this));
|
std::coroutine_handle<promise_type>::from_promise(*this));
|
||||||
|
|
||||||
return NonViralNonSuspendingInvoker<PostingPromiseTemplate>(*this);
|
return NonViralPostingInvoker<PostingPromiseTemplate>(*this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ struct NonViralNonSuspendingInvoker
|
|||||||
bool await_ready() const noexcept
|
bool await_ready() const noexcept
|
||||||
{ std::terminate(); }
|
{ std::terminate(); }
|
||||||
|
|
||||||
void await_suspend(std::coroutine_handle<NonViralNonSuspendingInvoker<PostingPromiseTemplate>>) noexcept
|
void await_suspend(std::coroutine_handle<NonViralPostingInvoker<PostingPromiseTemplate>>) noexcept
|
||||||
{ std::terminate(); }
|
{ std::terminate(); }
|
||||||
|
|
||||||
void await_resume() noexcept
|
void await_resume() noexcept
|
||||||
@@ -76,7 +77,7 @@ struct NonViralNonSuspendingInvoker
|
|||||||
* ~PostingInvoker destroys the callee frame (not await_resume).
|
* ~PostingInvoker destroys the callee frame (not await_resume).
|
||||||
*/
|
*/
|
||||||
template <template <typename> class PostingPromiseTemplate, typename T>
|
template <template <typename> class PostingPromiseTemplate, typename T>
|
||||||
struct ViralSuspendingInvoker
|
struct ViralPostingInvoker
|
||||||
: public PostingInvoker<PostingPromiseTemplate<T>, T>
|
: public PostingInvoker<PostingPromiseTemplate<T>, T>
|
||||||
{
|
{
|
||||||
struct promise_type
|
struct promise_type
|
||||||
@@ -84,15 +85,15 @@ struct ViralSuspendingInvoker
|
|||||||
{
|
{
|
||||||
using PostingPromiseTemplate<T>::PostingPromiseTemplate;
|
using PostingPromiseTemplate<T>::PostingPromiseTemplate;
|
||||||
|
|
||||||
ViralSuspendingInvoker<PostingPromiseTemplate, T> get_return_object() noexcept
|
ViralPostingInvoker<PostingPromiseTemplate, T> get_return_object() noexcept
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning ViralSuspendingInvoker.\n";
|
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning ViralPostingInvoker.\n";
|
||||||
#endif
|
#endif
|
||||||
this->setSelfSchedHandle(
|
this->setSelfSchedHandle(
|
||||||
std::coroutine_handle<promise_type>::from_promise(*this));
|
std::coroutine_handle<promise_type>::from_promise(*this));
|
||||||
|
|
||||||
return ViralSuspendingInvoker<PostingPromiseTemplate, T>(*this);
|
return ViralPostingInvoker<PostingPromiseTemplate, T>(*this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -111,7 +112,7 @@ struct ViralSuspendingInvoker
|
|||||||
{
|
{
|
||||||
static_assert(
|
static_assert(
|
||||||
std::is_base_of_v<PromiseChainLink, CallerPromise>,
|
std::is_base_of_v<PromiseChainLink, CallerPromise>,
|
||||||
"ViralSuspendingInvoker caller promise must derive from PromiseChainLink");
|
"ViralPostingInvoker caller promise must derive from PromiseChainLink");
|
||||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||||
std::cout << __func__ << ": " << std::this_thread::get_id() << " Setting callerSchedHandle.\n";
|
std::cout << __func__ << ": " << std::this_thread::get_id() << " Setting callerSchedHandle.\n";
|
||||||
#endif
|
#endif
|
||||||
@@ -144,6 +145,53 @@ struct ViralSuspendingInvoker
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Non-viral coroutine entry that must not be co_awaited: runs on the caller
|
||||||
|
* thread (initial_suspend is never) and invokes the completion lambda directly
|
||||||
|
* from final_suspend (no cross-thread posting).
|
||||||
|
*
|
||||||
|
* The invoker must outlive the callee frame: do not discard the return object
|
||||||
|
* from get_return_object(). ~NonPostingInvoker destroys the callee frame.
|
||||||
|
*/
|
||||||
|
struct NonViralNonPostingInvoker
|
||||||
|
: public NonPostingInvoker<NonPostingPromise>
|
||||||
|
{
|
||||||
|
struct promise_type
|
||||||
|
: public NonPostingPromise
|
||||||
|
{
|
||||||
|
using NonPostingPromise::NonPostingPromise;
|
||||||
|
|
||||||
|
NonViralNonPostingInvoker get_return_object()
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||||
|
std::cout << __func__ << ": " << std::this_thread::get_id() << " Returning NonViralNonPostingInvoker.\n";
|
||||||
|
#endif
|
||||||
|
if (!this->callerLambda)
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << std::this_thread::get_id()
|
||||||
|
<< ": Missing completion lambda: non-viral coroutines require a completion lambda.";
|
||||||
|
throw std::runtime_error(oss.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
this->setSelfSchedHandle(
|
||||||
|
std::coroutine_handle<promise_type>::from_promise(*this));
|
||||||
|
|
||||||
|
return NonViralNonPostingInvoker(*this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
using NonPostingInvoker<NonPostingPromise>::NonPostingInvoker;
|
||||||
|
|
||||||
|
bool await_ready() const noexcept
|
||||||
|
{ std::terminate(); }
|
||||||
|
|
||||||
|
void await_suspend(std::coroutine_handle<NonViralNonPostingInvoker>) noexcept
|
||||||
|
{ std::terminate(); }
|
||||||
|
|
||||||
|
void await_resume() noexcept
|
||||||
|
{ std::terminate(); }
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace sscl::co
|
} // namespace sscl::co
|
||||||
|
|
||||||
#endif // INVOKERS_H
|
#endif // INVOKERS_H
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#ifndef NON_POSTING_INVOKER_H
|
||||||
|
#define NON_POSTING_INVOKER_H
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <coroutine>
|
||||||
|
#include <iostream>
|
||||||
|
#include <thread>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include <spinscale/co/nonPostingPromise.h>
|
||||||
|
|
||||||
|
namespace sscl::co {
|
||||||
|
|
||||||
|
template <typename PromiseType>
|
||||||
|
class NonPostingInvoker
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit NonPostingInvoker(PromiseType &_calleePromise) noexcept
|
||||||
|
: calleePromise(_calleePromise)
|
||||||
|
{}
|
||||||
|
|
||||||
|
NonPostingInvoker(const NonPostingInvoker &) = delete;
|
||||||
|
NonPostingInvoker &operator=(const NonPostingInvoker &) = delete;
|
||||||
|
|
||||||
|
NonPostingInvoker(NonPostingInvoker &&other) noexcept
|
||||||
|
: calleePromise(other.calleePromise),
|
||||||
|
ownsFrameDestroy_(std::exchange(other.ownsFrameDestroy_, false))
|
||||||
|
{}
|
||||||
|
|
||||||
|
NonPostingInvoker &operator=(NonPostingInvoker &&other) = delete;
|
||||||
|
|
||||||
|
~NonPostingInvoker() noexcept
|
||||||
|
{
|
||||||
|
if (!ownsFrameDestroy_) { return; }
|
||||||
|
|
||||||
|
std::coroutine_handle<> handle = calleePromise.selfSchedHandle;
|
||||||
|
if (handle) {
|
||||||
|
handle.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValues<void> &completedReturnValues() noexcept
|
||||||
|
{ return calleePromise.returnValues; }
|
||||||
|
|
||||||
|
const ReturnValues<void> &completedReturnValues() const noexcept
|
||||||
|
{ return calleePromise.returnValues; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
PromiseType &calleePromise;
|
||||||
|
|
||||||
|
/** Every live invoker owns destruction of its callee coroutine frame in
|
||||||
|
* ~NonPostingInvoker (via calleePromise.selfSchedHandle).
|
||||||
|
*
|
||||||
|
* The only time frame destruction is skipped is for a moved-from invoker
|
||||||
|
* after move construction, so we do not double-destroy the same handle
|
||||||
|
* when get_return_object() returns the invoker by value.
|
||||||
|
*/
|
||||||
|
bool ownsFrameDestroy_ = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace sscl::co
|
||||||
|
|
||||||
|
#endif // NON_POSTING_INVOKER_H
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
#ifndef NON_POSTING_PROMISE_H
|
||||||
|
#define NON_POSTING_PROMISE_H
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
#include <coroutine>
|
||||||
|
#include <exception>
|
||||||
|
#include <functional>
|
||||||
|
#include <iostream>
|
||||||
|
#include <thread>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include <spinscale/co/coQutex.h>
|
||||||
|
#include <spinscale/co/promiseChainLink.h>
|
||||||
|
#include <spinscale/co/promises.h>
|
||||||
|
|
||||||
|
namespace sscl::co {
|
||||||
|
|
||||||
|
struct NonPostingPromise
|
||||||
|
: public PromiseChainLink
|
||||||
|
{
|
||||||
|
/** Completion work must run from this awaiter's await_suspend, not
|
||||||
|
* synchronously inside promise.final_suspend() before it returns: the
|
||||||
|
* hidden coroutine segment index in the coroutine state is only advanced
|
||||||
|
* after final_suspend exits. See docs/prompts/post-to-and-back-in-invokables.md.
|
||||||
|
*/
|
||||||
|
struct FinalSuspendNonPostingInvoker
|
||||||
|
: public std::suspend_always
|
||||||
|
{
|
||||||
|
explicit FinalSuspendNonPostingInvoker(NonPostingPromise &calleePromiseIn) noexcept
|
||||||
|
: calleePromise(calleePromiseIn)
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool await_suspend(std::coroutine_handle<> const) noexcept
|
||||||
|
{
|
||||||
|
if (calleePromise.callerLambda)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||||
|
std::cout << "final_suspend" << ": " << std::this_thread::get_id()
|
||||||
|
<< " Non-viral non-posting: invoking callerLambda directly.\n";
|
||||||
|
#endif
|
||||||
|
if (calleePromise.returnValues.myExceptionPtr) {
|
||||||
|
std::rethrow_exception(
|
||||||
|
calleePromise.returnValues.myExceptionPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
calleePromise.callerLambda();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
NonPostingPromise &calleePromise;
|
||||||
|
};
|
||||||
|
|
||||||
|
NonPostingPromise() noexcept
|
||||||
|
: returnValues()
|
||||||
|
{}
|
||||||
|
|
||||||
|
template <typename... TailArgs>
|
||||||
|
NonPostingPromise(
|
||||||
|
std::exception_ptr &callerExceptionPtr,
|
||||||
|
std::function<void()> callerLambdaIn,
|
||||||
|
TailArgs &&...) noexcept
|
||||||
|
: returnValues(callerExceptionPtr),
|
||||||
|
callerLambda(std::move(callerLambdaIn))
|
||||||
|
{}
|
||||||
|
|
||||||
|
~NonPostingPromise() noexcept
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||||
|
std::cout << __func__ << ": " << std::this_thread::get_id() << " Destructing.\n";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
std::suspend_never initial_suspend() noexcept
|
||||||
|
{ return {}; }
|
||||||
|
|
||||||
|
auto final_suspend() noexcept
|
||||||
|
{ return FinalSuspendNonPostingInvoker(*this); }
|
||||||
|
|
||||||
|
void return_void() noexcept
|
||||||
|
{ return; }
|
||||||
|
|
||||||
|
void unhandled_exception() noexcept
|
||||||
|
{
|
||||||
|
returnValues.myExceptionPtr = std::current_exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeAcquiredLock(CoQutex &coQutex) noexcept override
|
||||||
|
{
|
||||||
|
eraseFirstMatchingAcquiredLock(coQutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setSelfSchedHandle(std::coroutine_handle<> schedHandle) noexcept
|
||||||
|
{
|
||||||
|
selfSchedHandle = schedHandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValues<void> returnValues;
|
||||||
|
std::function<void()> callerLambda;
|
||||||
|
std::coroutine_handle<> selfSchedHandle;
|
||||||
|
|
||||||
|
template <typename>
|
||||||
|
friend class NonPostingInvoker;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace sscl::co
|
||||||
|
|
||||||
|
#endif // NON_POSTING_PROMISE_H
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <coroutine>
|
||||||
#include <spinscale/cps/callback.h>
|
#include <spinscale/cps/callback.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -160,8 +161,84 @@ public:
|
|||||||
|
|
||||||
void initializeTls(void);
|
void initializeTls(void);
|
||||||
|
|
||||||
// Thread management methods
|
|
||||||
typedef std::function<void()> threadLifetimeMgmtOpCbFn;
|
typedef std::function<void()> threadLifetimeMgmtOpCbFn;
|
||||||
|
|
||||||
|
struct ViralThreadLifetimeMgmtInvoker
|
||||||
|
{
|
||||||
|
ViralThreadLifetimeMgmtInvoker(
|
||||||
|
ThreadOp _threadOp,
|
||||||
|
PuppetThread &_parentThread,
|
||||||
|
const std::shared_ptr<PuppetThread> &_selfPtr = nullptr)
|
||||||
|
: threadOp(_threadOp), parentThread(_parentThread), selfPtr(_selfPtr)
|
||||||
|
{
|
||||||
|
cps::Callback<threadLifetimeMgmtOpCbFn> callback{
|
||||||
|
nullptr,
|
||||||
|
[this]()
|
||||||
|
{
|
||||||
|
settled = true;
|
||||||
|
if (callerSchedHandle) {
|
||||||
|
callerSchedHandle.resume();
|
||||||
|
}
|
||||||
|
}};
|
||||||
|
|
||||||
|
if (threadOp == ThreadOp::JOLT && selfPtr == nullptr)
|
||||||
|
{
|
||||||
|
throw std::runtime_error(std::string(__func__)
|
||||||
|
+ ": JOLT request must be made with a valid selfPtr");
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (threadOp)
|
||||||
|
{
|
||||||
|
case ThreadOp::START:
|
||||||
|
parentThread.startThreadReq(callback);
|
||||||
|
break;
|
||||||
|
case ThreadOp::PAUSE:
|
||||||
|
parentThread.pauseThreadReq(callback);
|
||||||
|
break;
|
||||||
|
case ThreadOp::RESUME:
|
||||||
|
parentThread.resumeThreadReq(callback);
|
||||||
|
break;
|
||||||
|
case ThreadOp::EXIT:
|
||||||
|
parentThread.exitThreadReq(callback);
|
||||||
|
break;
|
||||||
|
case ThreadOp::JOLT:
|
||||||
|
parentThread.joltThreadReq(selfPtr, callback);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw std::runtime_error(std::string(__func__)
|
||||||
|
+ ": Invalid thread operation");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool await_ready() const noexcept { return settled; }
|
||||||
|
|
||||||
|
bool await_suspend(
|
||||||
|
std::coroutine_handle<> _callerSchedHandle) noexcept
|
||||||
|
{
|
||||||
|
if (settled) { return false; }
|
||||||
|
callerSchedHandle = _callerSchedHandle;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void await_resume() noexcept {}
|
||||||
|
|
||||||
|
ThreadOp threadOp;
|
||||||
|
bool settled = false;
|
||||||
|
std::coroutine_handle<> callerSchedHandle;
|
||||||
|
PuppetThread &parentThread;
|
||||||
|
const std::shared_ptr<PuppetThread> selfPtr;
|
||||||
|
};
|
||||||
|
|
||||||
|
ViralThreadLifetimeMgmtInvoker startThreadAReq()
|
||||||
|
{ return ViralThreadLifetimeMgmtInvoker(ThreadOp::START, *this); }
|
||||||
|
ViralThreadLifetimeMgmtInvoker pauseThreadAReq()
|
||||||
|
{ return ViralThreadLifetimeMgmtInvoker(ThreadOp::PAUSE, *this); }
|
||||||
|
ViralThreadLifetimeMgmtInvoker resumeThreadAReq()
|
||||||
|
{ return ViralThreadLifetimeMgmtInvoker(ThreadOp::RESUME, *this); }
|
||||||
|
ViralThreadLifetimeMgmtInvoker exitThreadAReq()
|
||||||
|
{ return ViralThreadLifetimeMgmtInvoker(ThreadOp::EXIT, *this); }
|
||||||
|
|
||||||
void startThreadReq(cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
void startThreadReq(cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
||||||
void exitThreadReq(cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
void exitThreadReq(cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
||||||
void pauseThreadReq(cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
void pauseThreadReq(cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
||||||
@@ -178,6 +255,10 @@ public:
|
|||||||
* isn't set up yet, so shared_from_this() can't be used)
|
* isn't set up yet, so shared_from_this() can't be used)
|
||||||
* @param callback Callback to invoke when JOLT completes
|
* @param callback Callback to invoke when JOLT completes
|
||||||
*/
|
*/
|
||||||
|
ViralThreadLifetimeMgmtInvoker joltThreadAReq(
|
||||||
|
const std::shared_ptr<PuppetThread> &selfPtr)
|
||||||
|
{ return ViralThreadLifetimeMgmtInvoker(ThreadOp::JOLT, *this, selfPtr); }
|
||||||
|
|
||||||
void joltThreadReq(
|
void joltThreadReq(
|
||||||
const std::shared_ptr<PuppetThread>& selfPtr,
|
const std::shared_ptr<PuppetThread>& selfPtr,
|
||||||
cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
cps::Callback<threadLifetimeMgmtOpCbFn> callback);
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ public:
|
|||||||
|
|
||||||
// Thread management methods
|
// Thread management methods
|
||||||
typedef std::function<void()> puppetThreadLifetimeMgmtOpCbFn;
|
typedef std::function<void()> puppetThreadLifetimeMgmtOpCbFn;
|
||||||
void joltAllPuppetThreadsReq(
|
void joltAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
||||||
void startAllPuppetThreadsReq(
|
void startAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
||||||
void pauseAllPuppetThreadsReq(
|
void pauseAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
||||||
void resumeAllPuppetThreadsReq(
|
void resumeAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
||||||
void exitAllPuppetThreadsReq(
|
void exitAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback);
|
||||||
|
|
||||||
// CPU distribution method
|
// CPU distribution method
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void PuppetApplication::joltAllPuppetThreadsReq(
|
void PuppetApplication::joltAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -106,7 +106,7 @@ void PuppetApplication::joltAllPuppetThreadsReq(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuppetApplication::startAllPuppetThreadsReq(
|
void PuppetApplication::startAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -130,7 +130,7 @@ void PuppetApplication::startAllPuppetThreadsReq(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuppetApplication::pauseAllPuppetThreadsReq(
|
void PuppetApplication::pauseAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -154,7 +154,7 @@ void PuppetApplication::pauseAllPuppetThreadsReq(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuppetApplication::resumeAllPuppetThreadsReq(
|
void PuppetApplication::resumeAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -178,7 +178,7 @@ void PuppetApplication::resumeAllPuppetThreadsReq(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuppetApplication::exitAllPuppetThreadsReq(
|
void PuppetApplication::exitAllPuppetThreadsCReq(
|
||||||
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
cps::Callback<puppetThreadLifetimeMgmtOpCbFn> callback
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user