aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/can/can-bus.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-07 14:27:33 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-07 14:27:33 +0200
commit2e66a10937ca8189498b540e3e28047d829021ad (patch)
tree4cc4029b742334e487b7369683fc0f8e05e4107d /CAN-binder/low-can-binding/can/can-bus.hpp
parent4eb1cc0d69804337ac9e35dea6cc2e22c0fc76c6 (diff)
Improve reliability on multi-threading.
- Limits call to signals_manager and subscribed signals map - Unlock and lock mutex in the right order to avoid possible dead locks. Change-Id: Ifb152af833ad8bdde5dc4fc3a27b1a7c27046523 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-bus.hpp')
-rw-r--r--CAN-binder/low-can-binding/can/can-bus.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus.hpp b/CAN-binder/low-can-binding/can/can-bus.hpp
index 99d5a30f..b19519a8 100644
--- a/CAN-binder/low-can-binding/can/can-bus.hpp
+++ b/CAN-binder/low-can-binding/can/can-bus.hpp
@@ -29,7 +29,7 @@
#include "can-message.hpp"
#include "../utils/config-parser.hpp"
#include "../binding/low-can-hat.hpp"
-#include "../binding/low-can-cb.hpp"
+#include "../binding/low-can-subscription.hpp"
// TODO actual max is 32 but dropped to 24 for memory considerations
#define MAX_ACCEPTANCE_FILTERS 24
@@ -53,8 +53,8 @@ private:
utils::config_parser_t conf_file_; ///< configuration file handle used to initialize can_bus_dev_t objects.
bool apply_filter(const openxc_VehicleMessage& vehicle_message, std::shared_ptr<low_can_subscription_t> can_subscription);
- void process_can_signals(const can_message_t& can_message);
- void process_diagnostic_signals(diagnostic_manager_t& manager, const can_message_t& can_message);
+ void process_can_signals(const can_message_t& can_message, std::map<int, std::shared_ptr<low_can_subscription_t> >& s);
+ void process_diagnostic_signals(diagnostic_manager_t& manager, const can_message_t& can_message, std::map<int, std::shared_ptr<low_can_subscription_t> >& s);
void can_decode_message();
std::thread th_decoding_; ///< thread that'll handle decoding a can frame