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.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Log.h') diff --git a/src/Log.h b/src/Log.h index bf1d5e4..ae252a6 100644 --- a/src/Log.h +++ b/src/Log.h @@ -43,7 +43,7 @@ #include #include #include -#include +#include "ThreadsafeQueue.h" #define SYSLOG_IDENT "ODR-DabMod" #define SYSLOG_FACILITY LOG_LOCAL0 @@ -179,9 +179,7 @@ class Logger { private: std::list backends; - boost::lockfree::spsc_queue< - log_message_t, - boost::lockfree::capacity<80> > m_message_queue; + ThreadsafeQueue m_message_queue; std::thread m_io_thread; std::mutex m_cerr_mutex; }; -- cgit v1.2.3