Async: Drop-in SyncCancelerForAsyncWork without execUncancelableSegment*
We're doing this to prep for the coro port
This commit is contained in:
@@ -91,10 +91,7 @@ void StimulusProducer::destroyAttachedStimulusBuffer(
|
||||
|
||||
void StimulusProducer::stop()
|
||||
{
|
||||
{
|
||||
sscl::SpinLock::Guard lock(shouldContinueLock);
|
||||
shouldContinue = false;
|
||||
}
|
||||
(void)stimulusProducerCanceler.requestStop();
|
||||
|
||||
// Cancel timer immediately
|
||||
timer.cancel();
|
||||
@@ -105,7 +102,7 @@ void StimulusProducer::stop()
|
||||
|
||||
void StimulusProducer::scheduleNextTimeout(int delayMs)
|
||||
{
|
||||
if (!shouldContinue)
|
||||
if (stimulusProducerCanceler.isCancellationRequestedUnlocked())
|
||||
{ return; }
|
||||
|
||||
// Schedule the next timeout using the provided delay
|
||||
@@ -131,8 +128,8 @@ void StimulusProducer::onTimeout(const boost::system::error_code& error)
|
||||
return;
|
||||
}
|
||||
|
||||
sscl::SpinLock::Guard lock(shouldContinueLock);
|
||||
if (!shouldContinue)
|
||||
sscl::SpinLock::Guard guard(stimulusProducerCanceler.s.lock);
|
||||
if (stimulusProducerCanceler.isCancellationRequestedUnlocked())
|
||||
{ return; }
|
||||
|
||||
/** EXPLANATION:
|
||||
|
||||
Reference in New Issue
Block a user