BLOCKING_QUEUE: let audio-out try_push() too, else it often blocks evrything while in debugger...

This commit is contained in:
vsonnier 2017-02-18 10:15:47 +01:00
parent 8dfb8ea3f1
commit 051ebec49f

View File

@ -299,7 +299,7 @@ void DemodulatorThread::run() {
} }
if (!localAudioVisOutputQueue->try_push(ati_vis)) { if (!localAudioVisOutputQueue->try_push(ati_vis)) {
//non-blocking push for audio-out //non-blocking push needed for audio vis out
ati_vis->setRefCount(0); ati_vis->setRefCount(0);
std::cout << "DemodulatorThread::run() cannot push ati_vis into localAudioVisOutputQueue, is full !" << std::endl; std::cout << "DemodulatorThread::run() cannot push ati_vis into localAudioVisOutputQueue, is full !" << std::endl;
std::this_thread::yield(); std::this_thread::yield();
@ -308,8 +308,12 @@ void DemodulatorThread::run() {
if (ati != nullptr) { if (ati != nullptr) {
if (!muted.load() && (!wxGetApp().getSoloMode() || (demodInstance == wxGetApp().getDemodMgr().getLastActiveDemodulator()))) { if (!muted.load() && (!wxGetApp().getSoloMode() || (demodInstance == wxGetApp().getDemodMgr().getLastActiveDemodulator()))) {
//non-blocking push needed for audio out
audioOutputQueue->push(ati); if (!audioOutputQueue->try_push(ati)) {
ati->decRefCount();
std::cout << "DemodulatorThread::run() cannot push ati into audioOutputQueue, is full !" << std::endl;
std::this_thread::yield();
}
} else { } else {
ati->setRefCount(0); ati->setRefCount(0);
} }