1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 16:34:45 -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
+4 -6
View File
@@ -41,6 +41,9 @@ DSPDeviceEngine::DSPDeviceEngine(QObject* parent) :
m_qRange(1 << 16),
m_imbalance(65536)
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
connect(&m_syncMessenger, SIGNAL(messageSent()), this, SLOT(handleSynchronousMessages()), Qt::QueuedConnection);
moveToThread(this);
}
@@ -53,21 +56,16 @@ void DSPDeviceEngine::run()
{
qDebug() << "DSPDeviceEngine::run";
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
connect(&m_syncMessenger, SIGNAL(messageSent()), this, SLOT(handleSynchronousMessages()), Qt::QueuedConnection);
m_state = StIdle;
m_syncMessenger.done(); // Release start() that is waiting in main trhead
m_syncMessenger.done(); // Release start() that is waiting in main thread
exec();
}
void DSPDeviceEngine::start()
{
qDebug() << "DSPDeviceEngine::start";
DSPPing cmd;
QThread::start();
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceEngine::stop()