From 411d03ac6b8ee1a8c06f952b9378c90516a715b7 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 20 Apr 2018 12:29:24 +0200 Subject: ThreadsafeQueue: add wakeup event instead of custom termination markers This avoids the issue that the ~SDR termination marker doesn't reach the consumer because it's still prebuffering --- src/MemlessPoly.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/MemlessPoly.cpp') diff --git a/src/MemlessPoly.cpp b/src/MemlessPoly.cpp index 1e19071..88a68bc 100644 --- a/src/MemlessPoly.cpp +++ b/src/MemlessPoly.cpp @@ -280,9 +280,10 @@ void MemlessPoly::worker_thread(MemlessPoly::worker_t *workerdata) while (true) { worker_t::input_data_t in_data; - workerdata->in_queue.wait_and_pop(in_data); - - if (in_data.terminate) { + try { + workerdata->in_queue.wait_and_pop(in_data); + } + catch (const ThreadsafeQueueWakeup&) { break; } @@ -322,7 +323,6 @@ int MemlessPoly::internal_process(Buffer* const dataIn, Buffer* dataOut) size_t start = 0; for (auto& worker : m_workers) { worker_t::input_data_t dat; - dat.terminate = false; dat.dpd_type = m_dpd_type; dat.lut_scalefactor = m_lut_scalefactor; dat.lut = m_lut.data(); -- cgit v1.2.3