mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 06:04:39 -04:00
Make processing queues timed-push, to be able to escape deadlocks. Rollback 'restart device when blocked' that is ineffective in practice.
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
//2s
|
||||
#define MAX_BLOCKING_DURATION_MICROS (2000 * 1000)
|
||||
|
||||
|
||||
ScopeVisualProcessor::ScopeVisualProcessor(): outputBuffers("ScopeVisualProcessorBuffers") {
|
||||
scopeEnabled.store(true);
|
||||
spectrumEnabled.store(true);
|
||||
@@ -116,7 +120,7 @@ void ScopeVisualProcessor::process() {
|
||||
}
|
||||
|
||||
renderData->spectrum = false;
|
||||
distribute(renderData);
|
||||
distribute(renderData, MAX_BLOCKING_DURATION_MICROS, "renderData");
|
||||
}
|
||||
|
||||
if (spectrumEnabled) {
|
||||
@@ -212,7 +216,7 @@ void ScopeVisualProcessor::process() {
|
||||
renderData->fft_size = fftSize/2;
|
||||
renderData->spectrum = true;
|
||||
|
||||
distribute(renderData);
|
||||
distribute(renderData, MAX_BLOCKING_DURATION_MICROS, "renderData");
|
||||
}
|
||||
} //end if try_pop()
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
//50 ms
|
||||
#define HEARTBEAT_CHECK_PERIOD_MICROS (50 * 1000)
|
||||
|
||||
//2s
|
||||
#define MAX_BLOCKING_DURATION_MICROS (2000 * 1000)
|
||||
|
||||
|
||||
SpectrumVisualProcessor::SpectrumVisualProcessor() : outputBuffers("SpectrumVisualProcessorBuffers") {
|
||||
lastInputBandwidth = 0;
|
||||
lastBandwidth = 0;
|
||||
@@ -592,7 +596,7 @@ void SpectrumVisualProcessor::process() {
|
||||
output->centerFreq = centerFreq;
|
||||
output->bandwidth = bandwidth;
|
||||
|
||||
distribute(output);
|
||||
distribute(output, MAX_BLOCKING_DURATION_MICROS, "output");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user