From aa5c3cf6f9ab1e1f26559745bb64534f68a6f80a Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 26 Apr 2017 18:28:12 +0200 Subject: [PATCH] Fix: Add notifying decoding thread if there is new messages. Change-Id: If12617ae086d7023ff619799833cd1d4fd0fd413 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/can/can-bus.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CAN-binder/low-can-binding/can/can-bus.cpp b/CAN-binder/low-can-binding/can/can-bus.cpp index 0de8aeb..5f45624 100644 --- a/CAN-binder/low-can-binding/can/can-bus.cpp +++ b/CAN-binder/low-can-binding/can/can-bus.cpp @@ -80,7 +80,9 @@ int can_bus_t::can_reader() { can_message_t msg; s.second->get_socket() >> msg; - push_new_can_message(msg); + std::lock_guard can_message_lock(get_can_message_mutex()); + { push_new_can_message(msg); } + get_new_can_message_cv().notify_one(); } } } -- 2.16.6