mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-12 10:48:39 -04:00
Move code out of frame, proper thread termination
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "CubicSDR.h"
|
||||
|
||||
SDRThread::SDRThread(SDRThreadCommandQueue* pQueue) :
|
||||
m_pQueue(pQueue), iqDataOutQueue(NULL), iqVisualQueue(NULL) {
|
||||
m_pQueue(pQueue), iqDataOutQueue(NULL), iqVisualQueue(NULL), terminated(false) {
|
||||
dev = NULL;
|
||||
sample_rate = SRATE;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ void SDRThread::threadMain() {
|
||||
double seconds = 0.0;
|
||||
|
||||
std::cout << "Sampling..";
|
||||
while (1) {
|
||||
while (!terminated) {
|
||||
if (!m_pQueue->empty()) {
|
||||
bool freq_changed = false;
|
||||
float new_freq;
|
||||
@@ -186,3 +186,6 @@ void SDRThread::threadMain() {
|
||||
|
||||
}
|
||||
|
||||
void SDRThread::terminate() {
|
||||
terminated = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user