StimBuff: Add opportunity for early lock release

This commit is contained in:
2025-11-12 15:08:44 -04:00
parent d87c71b794
commit 116a642a9f
2 changed files with 24 additions and 31 deletions
+3 -3
View File
@@ -13,7 +13,6 @@
#include <boost/asio/io_service.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <spinLock.h>
#include <asynchronousBridge.h>
#include <user/spMcRingBuffer.h>
#include "stimulusFrame.h"
#include "deviceAttachmentSpec.h"
@@ -74,7 +73,7 @@ public:
std::cout << __func__ << ": Starting stimulus buffer for device "
<< deviceAttachmentSpec->deviceSelector << std::endl;
shouldContinue.store(true);
shouldContinue = true;
scheduleNextTimeout();
}
@@ -105,7 +104,8 @@ protected:
private:
boost::asio::io_service& ioService;
std::atomic<bool> shouldContinue;
SpinLock shouldContinueLock;
bool shouldContinue;
boost::asio::deadline_timer timer;
void scheduleNextTimeout(int delayMs = CONFIG_STIMBUFF_FRAME_PERIOD_MS);