diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-26 18:28:12 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-27 01:03:34 +0200 |
commit | aa5c3cf6f9ab1e1f26559745bb64534f68a6f80a (patch) | |
tree | 87299242907c59588c8f08f07ac26d1fe1e182a0 /CAN-binder/low-can-binding | |
parent | eb5fc27fce3d832f1f969ebb01056a69c5f4c120 (diff) |
Fix: Add notifying decoding thread if there is new messages.
Change-Id: If12617ae086d7023ff619799833cd1d4fd0fd413
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<std::mutex> can_message_lock(get_can_message_mutex()); + { push_new_can_message(msg); } + get_new_can_message_cv().notify_one(); } } } |