From 1387a04e605c3c511e2e4fc764eb6434b9837ef8 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 24 Feb 2017 13:37:17 +0100 Subject: Log: replace spsc queue by Threadsafequeue The function pushing messages into the queue gets called from more than one thread, which is illegal according to boost::lockfree documentation. --- src/Log.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Log.cpp') diff --git a/src/Log.cpp b/src/Log.cpp index 4780f58..0792fcf 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -77,9 +77,7 @@ void Logger::io_process() set_thread_name("logger"); while (1) { log_message_t m; - while (m_message_queue.pop(m) == false) { - std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } + m_message_queue.wait_and_pop(m); auto message = m.message; -- cgit v1.2.3