StimProd,DevReattacher: use CDaemon nonviral nursery coro

We ported these two daemons over to the new nursery mechanism and
they work nicely.
This commit is contained in:
2026-06-09 19:47:44 -04:00
parent 165c846700
commit 87a8de9a2b
6 changed files with 136 additions and 124 deletions
-1
View File
@@ -13,7 +13,6 @@
#define CONFIG_MRNTT_DEVMGR_REATTACHER_PERIOD_MS @MRNTT_DEVMGR_REATTACHER_PERIOD_MS@
/* Stimulus buffer frame period configuration */
#define CONFIG_STIMBUFF_FRAME_PERIOD_MS @CONFIG_STIMBUFF_FRAME_PERIOD_MS@
#define CONFIG_STIMBUFF_FRAME_RETRY_DELAY_MS @CONFIG_STIMBUFF_FRAME_RETRY_DELAY_MS@
/* World thread configuration */
#cmakedefine CONFIG_WORLD_USE_BODY_THREAD
+2 -9
View File
@@ -12,7 +12,6 @@
#include <boost/asio/deadline_timer.hpp>
#include <spinscale/co/invokers.h>
#include <spinscale/co/nonViralTaskNursery.h>
#include <spinscale/spinLock.h>
#include <spinscale/syncCancelerForAsyncWork.h>
#include "deviceAttachmentSpec.h"
@@ -39,7 +38,7 @@ public:
const std::shared_ptr<device::DeviceAttachmentSpec>
&deviceAttachmentSpec,
boost::asio::io_context& ioContext_)
: daemonTimer(ioContext_), nDeferrals(0),
: daemonTimer(ioContext_),
deviceAttachmentSpec(deviceAttachmentSpec), ioContext(ioContext_)
{}
@@ -54,9 +53,6 @@ public:
virtual void start();
virtual void stop();
void allowNextStimulusFrame()
{ frameAssemblyRateLimiter.release(); }
virtual std::shared_ptr<StimulusBuffer> getAttachedStimulusBuffer(
const std::shared_ptr<device::DeviceAttachmentSpec>& spec) const;
@@ -77,8 +73,6 @@ public:
bool hasBufferWithQualeIfaceApi(const std::string& qualeIfaceApi) const;
protected:
sscl::SpinLock frameAssemblyRateLimiter;
// Virtual functions for derived classes to override
virtual int getStopDelayMs() const
{
@@ -96,8 +90,7 @@ protected:
sscl::co::NonViralTaskNursery taskNursery;
boost::asio::deadline_timer daemonTimer;
size_t nDeferrals;
std::chrono::high_resolution_clock::time_point deferralStartTime;
size_t nTimesliceOverruns = 0;
public:
std::shared_ptr<device::DeviceAttachmentSpec> deviceAttachmentSpec;