fix(napi): cargo doc build
- Close https://github.com/napi-rs/napi-rs/issues/1800
This commit is contained in:
parent
751312cec9
commit
7dced934a7
3 changed files with 7 additions and 7 deletions
|
@ -7,7 +7,7 @@ use std::sync::{
|
|||
Arc,
|
||||
};
|
||||
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
use crate::bindgen_prelude::{CUSTOM_GC_TSFN, CUSTOM_GC_TSFN_DESTROYED, THREADS_CAN_ACCESS_ENV};
|
||||
pub use crate::js_values::TypedArrayType;
|
||||
use crate::{check_status, sys, Error, Result, Status};
|
||||
|
@ -80,7 +80,7 @@ macro_rules! impl_typed_array {
|
|||
if ref_.is_null() {
|
||||
return;
|
||||
}
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
{
|
||||
if CUSTOM_GC_TSFN_DESTROYED.load(Ordering::SeqCst) {
|
||||
return;
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::sync::Arc;
|
|||
#[cfg(all(debug_assertions, not(windows)))]
|
||||
use std::sync::Mutex;
|
||||
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
use crate::bindgen_prelude::{CUSTOM_GC_TSFN, CUSTOM_GC_TSFN_DESTROYED, THREADS_CAN_ACCESS_ENV};
|
||||
use crate::{bindgen_prelude::*, check_status, sys, Result, ValueType};
|
||||
|
||||
|
@ -37,7 +37,7 @@ impl Drop for Buffer {
|
|||
if ref_.is_null() {
|
||||
return;
|
||||
}
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
{
|
||||
if CUSTOM_GC_TSFN_DESTROYED.load(std::sync::atomic::Ordering::SeqCst) {
|
||||
return;
|
||||
|
|
|
@ -74,12 +74,12 @@ static IS_FIRST_MODULE: AtomicBool = AtomicBool::new(true);
|
|||
static FIRST_MODULE_REGISTERED: AtomicBool = AtomicBool::new(false);
|
||||
static REGISTERED_CLASSES: Lazy<RegisteredClassesMap> = Lazy::new(Default::default);
|
||||
static FN_REGISTER_MAP: Lazy<FnRegisterMap> = Lazy::new(Default::default);
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
pub(crate) static CUSTOM_GC_TSFN: AtomicPtr<sys::napi_threadsafe_function__> =
|
||||
AtomicPtr::new(ptr::null_mut());
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
pub(crate) static CUSTOM_GC_TSFN_DESTROYED: AtomicBool = AtomicBool::new(false);
|
||||
#[cfg(all(feature = "napi4", not(target_os = "wasi")))]
|
||||
#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))]
|
||||
// Store thread id of the thread that created the CustomGC ThreadsafeFunction.
|
||||
pub(crate) static THREADS_CAN_ACCESS_ENV: once_cell::sync::Lazy<
|
||||
PersistedPerInstanceHashMap<ThreadId, bool>,
|
||||
|
|
Loading…
Reference in a new issue