diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-02-24 13:37:17 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-02-24 13:37:17 +0100 |
commit | 1387a04e605c3c511e2e4fc764eb6434b9837ef8 (patch) | |
tree | 6c89af8032bcaa2982bb8e7e9e246fc641f7c4e0 /src/Log.cpp | |
parent | ebe96d69b44d73875f922a7fc59da02695969b00 (diff) | |
download | dabmod-1387a04e605c3c511e2e4fc764eb6434b9837ef8.tar.gz dabmod-1387a04e605c3c511e2e4fc764eb6434b9837ef8.tar.bz2 dabmod-1387a04e605c3c511e2e4fc764eb6434b9837ef8.zip |
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.
Diffstat (limited to 'src/Log.cpp')
-rw-r--r-- | src/Log.cpp | 4 |
1 files changed, 1 insertions, 3 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; |