1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 13:47:01 -04:00

Attempt at fixing some race conditions #1

This commit is contained in:
f4exb
2015-10-21 02:32:21 +02:00
parent 2f9dd5a7ab
commit 35440d60f6
6 changed files with 14 additions and 19 deletions
+2 -2
View File
@@ -83,12 +83,12 @@ bool HackRFInput::start(int device)
return false;
}
m_hackRFThread->startWork();
mutexLocker.unlock();
applySettings(m_settings, true);
m_hackRFThread->startWork();
qDebug("HackRFInput::startInput: started");
return true;
+7 -5
View File
@@ -43,16 +43,18 @@ HackRFThread::~HackRFThread()
void HackRFThread::startWork()
{
m_startWaitMutex.lock();
//m_startWaitMutex.lock();
m_running = true;
start();
/*
while(!m_running)
m_startWaiter.wait(&m_startWaitMutex, 100);
m_startWaitMutex.unlock();
m_startWaitMutex.unlock();*/
}
void HackRFThread::stopWork()
{
qDebug("AirspyThread::stopWork");
qDebug("HackRFThread::stopWork");
m_running = false;
wait();
}
@@ -76,7 +78,7 @@ void HackRFThread::run()
{
hackrf_error rc;
m_running = true;
//m_running = true;
m_startWaiter.wakeAll();
rc = (hackrf_error) hackrf_start_rx(m_dev, rx_callback, NULL);
@@ -104,7 +106,7 @@ void HackRFThread::run()
qDebug("HackRFThread::run: failed to stop HackRF Rx: %s", hackrf_error_name(rc));
}
m_running = false;
//m_running = false;
}
// Decimate according to specified log2 (ex: log2=4 => decim=16)