From e9f43495c2f7dfa53a0eef7cc49cb211c5bb3a27 Mon Sep 17 00:00:00 2001 From: Martin Madsen Date: Wed, 16 Feb 2022 18:02:10 +0100 Subject: [PATCH] chore(napi): Mark shutdown_tokio_rt unsafe --- crates/napi/src/tokio_runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/napi/src/tokio_runtime.rs b/crates/napi/src/tokio_runtime.rs index 6777b43e..9fbac24b 100644 --- a/crates/napi/src/tokio_runtime.rs +++ b/crates/napi/src/tokio_runtime.rs @@ -35,7 +35,7 @@ pub(crate) static TOKIO_RT_REF_COUNT: AtomicUsize = AtomicUsize::new(0); #[doc(hidden)] #[inline(never)] -pub extern "C" fn shutdown_tokio_rt(arg: *mut c_void) { +pub unsafe extern "C" fn shutdown_tokio_rt(arg: *mut c_void) { if TOKIO_RT_REF_COUNT.fetch_sub(1, Ordering::Relaxed) == 0 { let sender = &RT.1; if let Err(e) = sender.clone().try_send(()) {