mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-04-05 19:18:40 -04:00
More terminate()-and-flush calls missed before
This commit is contained in:
parent
dc9c67bec1
commit
3842cf087f
@ -25,8 +25,8 @@ public:
|
||||
|
||||
void onBindOutput(std::string name, ThreadQueueBasePtr threadQueue);
|
||||
|
||||
void run();
|
||||
void terminate();
|
||||
virtual void run();
|
||||
virtual void terminate();
|
||||
|
||||
void setMuted(bool state);
|
||||
bool isMuted();
|
||||
|
@ -84,3 +84,9 @@ void FFTVisualDataThread::run() {
|
||||
// std::cout << "FFT visual data thread done." << std::endl;
|
||||
}
|
||||
|
||||
void FFTVisualDataThread::terminate() {
|
||||
IOThread::terminate();
|
||||
fftDistrib.flushQueues();
|
||||
wproc.flushQueues();
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,8 @@ public:
|
||||
SpectrumVisualProcessor *getProcessor();
|
||||
|
||||
virtual void run();
|
||||
|
||||
virtual void terminate();
|
||||
|
||||
protected:
|
||||
FFTDataDistributor fftDistrib;
|
||||
|
@ -28,3 +28,7 @@ void SpectrumVisualDataThread::run() {
|
||||
// std::cout << "Spectrum visual data thread done." << std::endl;
|
||||
}
|
||||
|
||||
void SpectrumVisualDataThread::terminate() {
|
||||
IOThread::terminate();
|
||||
sproc.flushQueues();
|
||||
}
|
@ -13,6 +13,8 @@ public:
|
||||
SpectrumVisualProcessor *getProcessor();
|
||||
|
||||
virtual void run();
|
||||
|
||||
virtual void terminate();
|
||||
|
||||
protected:
|
||||
SpectrumVisualProcessor sproc;
|
||||
|
@ -82,6 +82,17 @@ public:
|
||||
outputs.erase(i);
|
||||
}
|
||||
}
|
||||
//Flush all queues, either input or outputs clearing their accumulated messages.
|
||||
//this is purposefully non-blocking call.
|
||||
void flushQueues() {
|
||||
//DO NOT take the busy_update, we want a never blocking op how imperfect it could be.
|
||||
input->flush();
|
||||
|
||||
for (auto single_output : outputs) {
|
||||
|
||||
single_output->flush();
|
||||
}
|
||||
}
|
||||
|
||||
//Call process() repeateadly until all available 'input' data is consumed.
|
||||
void run() {
|
||||
|
@ -564,6 +564,15 @@ void SDRThread::run() {
|
||||
std::cout << "SDR thread done." << std::endl;
|
||||
}
|
||||
|
||||
void SDRThread::terminate() {
|
||||
IOThread::terminate();
|
||||
|
||||
SDRThreadIQDataQueuePtr iqDataOutQueue = std::static_pointer_cast<SDRThreadIQDataQueue>(getOutputQueue("IQDataOutput"));
|
||||
|
||||
if (iqDataOutQueue != nullptr) {
|
||||
iqDataOutQueue->flush();
|
||||
}
|
||||
}
|
||||
|
||||
SDRDeviceInfo *SDRThread::getDevice() {
|
||||
return deviceInfo.load();
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
enum SDRThreadState { SDR_THREAD_MESSAGE, SDR_THREAD_INITIALIZED, SDR_THREAD_FAILED};
|
||||
|
||||
virtual void run();
|
||||
virtual void terminate();
|
||||
|
||||
SDRDeviceInfo *getDevice();
|
||||
void setDevice(SDRDeviceInfo *dev);
|
||||
|
Loading…
Reference in New Issue
Block a user