Async: Drop-in SyncCancelerForAsyncWork without execUncancelableSegment*
We're doing this to prep for the coro port
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user