chore(napi): Mark shutdown_tokio_rt unsafe

This commit is contained in:
Martin Madsen 2022-02-16 18:02:10 +01:00
parent 5a0c1c2af3
commit e9f43495c2

View file

@ -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(()) {