From: Romain Forlot Date: Wed, 26 Apr 2017 16:28:12 +0000 (+0200) Subject: Fix: Add notifying decoding thread if there is new messages. X-Git-Tag: 3.99.1~118 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=aa5c3cf6f9ab1e1f26559745bb64534f68a6f80a;p=apps%2Flow-level-can-service.git Fix: Add notifying decoding thread if there is new messages. Change-Id: If12617ae086d7023ff619799833cd1d4fd0fd413 Signed-off-by: Romain Forlot --- 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(); } } }