StimBuff: Add opportunity for early lock release
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user