From 18f3c168f232ac4de431063b1fd53c1e89702edf Mon Sep 17 00:00:00 2001 From: Hasini Gunasinghe Date: Mon, 9 Dec 2024 20:26:14 +0000 Subject: Implement Send for RpcServerConnection Test: N/A Bug: 382291660 Change-Id: I0e5fbede384c67439d54c7b8f53ae8622886f704 --- libs/binder/rust/rpcbinder/src/server/trusty.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/binder/rust/rpcbinder/src/server/trusty.rs b/libs/binder/rust/rpcbinder/src/server/trusty.rs index fe45decf25..54d82d5bd0 100644 --- a/libs/binder/rust/rpcbinder/src/server/trusty.rs +++ b/libs/binder/rust/rpcbinder/src/server/trusty.rs @@ -106,6 +106,10 @@ pub struct RpcServerConnection { ctx: *mut c_void, } +// SAFETY: The opaque handle: `ctx` points into a dynamic allocation, +// and not tied to anything specific to the current thread. +unsafe impl Send for RpcServerConnection {} + impl Drop for RpcServerConnection { fn drop(&mut self) { // We do not need to close handle_fd since we do not own it. -- cgit v1.2.3-59-g8ed1b