summaryrefslogtreecommitdiffstats
path: root/src/can_reader.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-02-24 11:10:02 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-02-24 11:12:55 +0000
commit5c0c41e87ed5d1a2de7d336465c3beb3987a299f (patch)
tree7ac1dcf406354f489c095664739a3a15d754601d /src/can_reader.cpp
parentec6579686e46f39205547a5a54efe3c9e671aee8 (diff)
Remove socket read management by systemd event
loop and use classic thread with a blocking read Change-Id: Iac5428009b57c727bb32bd4893bc3fe282ba35c7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can_reader.cpp')
-rw-r--r--src/can_reader.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/can_reader.cpp b/src/can_reader.cpp
index e2f62774..018c7cba 100644
--- a/src/can_reader.cpp
+++ b/src/can_reader.cpp
@@ -27,13 +27,7 @@ void can_reader(can_bus_dev_t &can_bus_dev, can_bus_t& can_bus)
while(can_bus_dev.is_running())
{
- /* Declare and take lock ownership of can_frame_mutex.
- * then waiting notification for a new can frame arrival
- */
- std::unique_lock<std::mutex> can_frame_lock(can_frame_mutex);
- new_can_frame.wait(can_frame_lock);
- can_message.convert_from_canfd_frame(can_bus_dev.read());
- can_frame_mutex.unlock();
+ can_message.convert_from_canfd_frame(can_bus_dev.read());
std::lock_guard<std::mutex> can_message_lock(can_message_mutex);
can_bus.push_new_can_message(can_message);