mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-07 08:24:47 -04:00
THREAD_CLEAN: Clearly distinguish between a request to stop by terminate() from the actual termination isTerminated()
This commit is contained in:
@@ -380,7 +380,7 @@ void AudioThread::run() {
|
||||
inputQueue = static_cast<AudioThreadInputQueue *>(getInputQueue("AudioDataInput"));
|
||||
threadQueueNotify = static_cast<DemodulatorThreadCommandQueue*>(getOutputQueue("NotifyQueue"));
|
||||
|
||||
while (!terminated) {
|
||||
while (!stopping) {
|
||||
AudioThreadCommand command;
|
||||
cmdQueue.pop(command);
|
||||
|
||||
@@ -430,7 +430,7 @@ void AudioThread::run() {
|
||||
}
|
||||
|
||||
void AudioThread::terminate() {
|
||||
terminated = true;
|
||||
IOThread::terminate();
|
||||
AudioThreadCommand endCond; // push an empty input to bump the queue
|
||||
cmdQueue.push(endCond);
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
int getOutputDevice();
|
||||
void setSampleRate(int sampleRate);
|
||||
int getSampleRate();
|
||||
void run();
|
||||
void terminate();
|
||||
virtual void run();
|
||||
virtual void terminate();
|
||||
|
||||
bool isActive();
|
||||
void setActive(bool state);
|
||||
|
||||
Reference in New Issue
Block a user