aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Log.cpp4
-rw-r--r--src/Log.h6
2 files changed, 3 insertions, 7 deletions
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;
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 <map>
#include <mutex>
#include <thread>
-#include <boost/lockfree/spsc_queue.hpp>
+#include "ThreadsafeQueue.h"
#define SYSLOG_IDENT "ODR-DabMod"
#define SYSLOG_FACILITY LOG_LOCAL0
@@ -179,9 +179,7 @@ class Logger {
private:
std::list<LogBackend*> backends;
- boost::lockfree::spsc_queue<
- log_message_t,
- boost::lockfree::capacity<80> > m_message_queue;
+ ThreadsafeQueue<log_message_t> m_message_queue;
std::thread m_io_thread;
std::mutex m_cerr_mutex;
};