From 53cd1bc904249ab0a70adacd0f047ec803d09e2b Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 14 Jun 2023 15:24:01 +0800 Subject: [PATCH] fix(napi): impl send + sync for ThreadsafeFunction (#1622) --- crates/napi/src/threadsafe_function.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/napi/src/threadsafe_function.rs b/crates/napi/src/threadsafe_function.rs index 85421f35..33ba7ee7 100644 --- a/crates/napi/src/threadsafe_function.rs +++ b/crates/napi/src/threadsafe_function.rs @@ -235,6 +235,9 @@ pub struct ThreadsafeFunction, } +unsafe impl Send for ThreadsafeFunction {} +unsafe impl Sync for ThreadsafeFunction {} + impl Clone for ThreadsafeFunction { fn clone(&self) -> Self { self.handle.with_read_aborted(|aborted| {