Fix: Add notifying decoding thread if there is new messages.
authorRomain Forlot <romain.forlot@iot.bzh>
Wed, 26 Apr 2017 16:28:12 +0000 (18:28 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Wed, 26 Apr 2017 23:03:34 +0000 (01:03 +0200)
Change-Id: If12617ae086d7023ff619799833cd1d4fd0fd413
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
CAN-binder/low-can-binding/can/can-bus.cpp

index 0de8aeb..5f45624 100644 (file)
@@ -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();
                                        }
                                }
                }