From b4f03616bbf4b69c1f644b4c58462ef9a8e7f8a9 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 13 Mar 2017 00:04:37 +0100 Subject: Default value about thread state set at false. Change-Id: I1934aa4d9a9d945a32d8e369cf0f36b1e06d3f34 Signed-off-by: Romain Forlot --- src/can/can-bus-dev.hpp | 2 +- src/can/can-bus.cpp | 11 +---------- src/can/can-bus.hpp | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/can/can-bus-dev.hpp b/src/can/can-bus-dev.hpp index affcb34..c0ef8da 100644 --- a/src/can/can-bus-dev.hpp +++ b/src/can/can-bus-dev.hpp @@ -42,7 +42,7 @@ private: struct sockaddr_can txAddress_; /// < internal member using to bind to the socket std::thread th_reading_; /// < Thread handling read the socket can device filling can_message_q_ queue of can_bus_t - bool is_running_; /// < boolean telling whether or not reading is running or not + bool is_running_ = false; /// < boolean telling whether or not reading is running or not void can_reader(can_bus_t& can_bus); public: diff --git a/src/can/can-bus.cpp b/src/can/can-bus.cpp index d2b51bf..469b55d 100644 --- a/src/can/can-bus.cpp +++ b/src/can/can-bus.cpp @@ -232,15 +232,7 @@ std::vector can_bus_t::read_conf() jo = json_tokener_parse(fd_conf_content.c_str()); if (jo == NULL || !json_object_object_get_ex(jo, "canbus", &canbus)) - {/** -* @brief Telling if the pushing thread is running -* This is the boolean value on which the while loop -* take its condition. Set it to false will stop the -* according thread. -* -* @return true if pushing thread is running, false if not. -*/ - + { ERROR(binder_interface, "Can't find canbus node in the configuration file. Please review it."); ret.clear(); } @@ -353,4 +345,3 @@ const std::vector>& can_bus_t::get_can_devices() { return can_devices_; } - diff --git a/src/can/can-bus.hpp b/src/can/can-bus.hpp index d4d6d74..a001d1e 100644 --- a/src/can/can-bus.hpp +++ b/src/can/can-bus.hpp @@ -53,11 +53,11 @@ private: void can_decode_message(); std::thread th_decoding_; /// < thread that'll handle decoding a can frame - bool is_decoding_; /// < boolean member controling thread while loop + bool is_decoding_ = false; /// < boolean member controling thread while loop void can_event_push(); std::thread th_pushing_; /// < thread that'll handle pushing decoded can frame to subscribers - bool is_pushing_; /// < boolean member controling thread while loop + bool is_pushing_ = false; /// < boolean member controling thread while loop std::condition_variable new_can_message_cv_; /// < condition_variable use to wait until there is a new CAN message to read std::mutex can_message_mutex_; /// < mutex protecting the can_message_q_ queue. -- cgit 1.2.3-korg