THREAD_CLEAN: Clearly distinguish between a request to stop by terminate() from the actual termination isTerminated()

This commit is contained in:
vsonnier
2016-06-28 21:04:52 +02:00
parent c57478dc2a
commit 52de909cfb
23 changed files with 130 additions and 58 deletions
+2 -2
View File
@@ -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);
}
+2 -2
View File
@@ -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);