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/Log.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Log.h') diff --git a/src/Log.h b/src/Log.h index 0e09bc9..df6e07b 100644 --- a/src/Log.h +++ b/src/Log.h @@ -138,10 +138,7 @@ class Logger { Logger(const Logger& other) = delete; const Logger& operator=(const Logger& other) = delete; ~Logger() { - // Special message to stop the thread - log_message_t m(trace, ""); - - m_message_queue.push(m); + m_message_queue.trigger_wakeup(); m_io_thread.join(); } -- cgit v1.2.3