From 13651c5ff13176393868f83c67b0bddc11f54bc6 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 20 Mar 2024 22:30:45 +0800 Subject: [PATCH] chore(napi): add Send and Sync to Reference (#2007) --- crates/napi/src/bindgen_runtime/js_values/value_ref.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/napi/src/bindgen_runtime/js_values/value_ref.rs b/crates/napi/src/bindgen_runtime/js_values/value_ref.rs index d325bddb..9ab7db42 100644 --- a/crates/napi/src/bindgen_runtime/js_values/value_ref.rs +++ b/crates/napi/src/bindgen_runtime/js_values/value_ref.rs @@ -29,6 +29,9 @@ pub struct Reference { finalize_callbacks: Rc>, } +unsafe impl Send for Reference {} +unsafe impl Sync for Reference {} + impl Drop for Reference { fn drop(&mut self) { let rc_strong_count = Rc::strong_count(&self.finalize_callbacks);