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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user