From 80c0db3f35c9c7ab3d48da87292134e4b4b416d1 Mon Sep 17 00:00:00 2001 From: Martin Dahl Date: Thu, 19 Aug 2021 14:06:50 +0200 Subject: [PATCH] impl Send for Action client goals --- Cargo.toml | 2 +- src/action_clients.rs | 2 ++ src/action_clients_untyped.rs | 2 ++ src/msg_types.rs | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ec103c5..138b5ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "r2r" -version = "0.3.7" +version = "0.3.8" authors = ["Martin Dahl "] description = "Minimal ros2 bindings." license = "Apache-2.0/MIT" diff --git a/src/action_clients.rs b/src/action_clients.rs index 1b88506..c59ad11 100644 --- a/src/action_clients.rs +++ b/src/action_clients.rs @@ -10,6 +10,8 @@ where client: Weak>>, } +unsafe impl Send for ClientGoal where T: WrappedActionTypeSupport {} + #[derive(Clone)] pub struct ClientGoal where diff --git a/src/action_clients_untyped.rs b/src/action_clients_untyped.rs index 753049e..da4b497 100644 --- a/src/action_clients_untyped.rs +++ b/src/action_clients_untyped.rs @@ -11,6 +11,8 @@ pub struct ActionClientUntyped { client: Weak>, } +unsafe impl Send for ClientGoalUntyped {} + #[derive(Clone)] pub struct ClientGoalUntyped { client: Weak>, diff --git a/src/msg_types.rs b/src/msg_types.rs index bcc0829..b60d9af 100644 --- a/src/msg_types.rs +++ b/src/msg_types.rs @@ -117,6 +117,7 @@ pub struct WrappedNativeMsgUntyped { ) -> std::result::Result<(), serde_json::error::Error>, } +unsafe impl Send for UntypedServiceSupport {} pub struct UntypedServiceSupport { pub ts: &'static rosidl_service_type_support_t, pub make_request_msg: fn() -> WrappedNativeMsgUntyped, @@ -140,6 +141,7 @@ impl UntypedServiceSupport { } // For now only the client side is implemented. +unsafe impl Send for UntypedActionSupport {} pub struct UntypedActionSupport { pub(crate) ts: &'static rosidl_action_type_support_t,