Async: Drop-in SyncCancelerForAsyncWork without execUncancelableSegment*

We're doing this to prep for the coro port
This commit is contained in:
2026-05-30 10:52:15 -04:00
parent c7dee57072
commit f100764bd8
9 changed files with 72 additions and 91 deletions
+4 -5
View File
@@ -14,6 +14,7 @@
#include <boost/asio/io_service.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <spinscale/spinLock.h>
#include <spinscale/syncCancelerForAsyncWork.h>
#include "deviceAttachmentSpec.h"
namespace smo {
@@ -41,8 +42,7 @@ public:
boost::asio::io_service& ioService_)
: deviceAttachmentSpec(deviceAttachmentSpec),
ioService(ioService_),
shouldContinue(false), timer(ioService),
nDeferrals(0)
timer(ioService), nDeferrals(0)
{}
virtual ~StimulusProducer() = default;
@@ -59,7 +59,7 @@ public:
std::cout << __func__ << ": Starting stimulus producer for device "
<< deviceAttachmentSpec->deviceSelector << std::endl;
shouldContinue = true;
stimulusProducerCanceler.startAcceptingWork();
nDeferrals = 0;
scheduleNextTimeout();
}
@@ -109,8 +109,7 @@ public:
private:
boost::asio::io_service& ioService;
protected:
sscl::SpinLock shouldContinueLock;
bool shouldContinue;
sscl::SyncCancelerForAsyncWork stimulusProducerCanceler;
private:
boost::asio::deadline_timer timer;
size_t nDeferrals;