summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/binding/low-can-hat.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/binding/low-can-hat.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/binding/low-can-hat.hpp')
-rw-r--r--CAN-binder/low-can-binding/binding/low-can-hat.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/CAN-binder/low-can-binding/binding/low-can-hat.hpp b/CAN-binder/low-can-binding/binding/low-can-hat.hpp
index 632dbc90..233d7987 100644
--- a/CAN-binder/low-can-binding/binding/low-can-hat.hpp
+++ b/CAN-binder/low-can-binding/binding/low-can-hat.hpp
@@ -19,6 +19,7 @@
#pragma once
#include <cstddef>
+#include <map>
#include <string>
#include <memory>
#include <systemd/sd-event.h>
@@ -34,8 +35,8 @@ extern const struct afb_binding_interface *binder_interface;
class low_can_subscription_t;
-void on_no_clients(std::shared_ptr<low_can_subscription_t> can_subscription);
-void on_no_clients(std::shared_ptr<low_can_subscription_t> can_subscription, uint32_t pid);
+void on_no_clients(std::shared_ptr<low_can_subscription_t> can_subscription, std::map<int, std::shared_ptr<low_can_subscription_t> >& s);
+void on_no_clients(std::shared_ptr<low_can_subscription_t> can_subscription, uint32_t pid, std::map<int, std::shared_ptr<low_can_subscription_t> >& s);
int read_message(sd_event_source *s, int fd, uint32_t revents, void *userdata);
void subscribe(struct afb_req request);