use crate::pools::pool_impl::*;
#[cfg(feature = "std")]
use std::sync::LazyLock;
#[cfg(all(feature = "std", feature = "wasm", target_arch = "wasm32"))]
static PERSISTENT_POOL: LazyLock<WasmWebPool> = LazyLock::new(Default::default);
#[cfg(all(
feature = "std",
feature = "persistent-pool-rayon",
not(all(feature = "wasm", target_arch = "wasm32")),
))]
static PERSISTENT_POOL: LazyLock<rayon_core::ThreadPool> =
LazyLock::new(build_default_rayon_thread_pool);
#[cfg(all(
feature = "std",
feature = "transient-pool",
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
))]
static PERSISTENT_POOL: LazyLock<OncePool> = LazyLock::new(Default::default);
#[cfg(all(
feature = "std",
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
not(feature = "transient-pool"),
))]
static PERSISTENT_POOL: LazyLock<BasicPool> = LazyLock::new(Default::default);
#[cfg(all(
not(feature = "std"),
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
not(feature = "transient-pool"),
))]
static PERSISTENT_POOL: SequentialPool = SequentialPool;
#[cfg(all(feature = "std", feature = "wasm", target_arch = "wasm32"))]
pub type DefaultPool = &'static WasmWebPool;
#[cfg(all(
feature = "std",
feature = "persistent-pool-rayon",
not(all(feature = "wasm", target_arch = "wasm32")),
))]
pub type DefaultPool = &'static rayon_core::ThreadPool;
#[cfg(all(
feature = "std",
feature = "transient-pool",
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
))]
pub type DefaultPool = &'static OncePool;
#[cfg(all(
feature = "std",
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
not(feature = "transient-pool"),
))]
pub type DefaultPool = &'static BasicPool;
#[cfg(all(
not(feature = "std"),
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
not(feature = "transient-pool"),
))]
pub type DefaultPool = &'static SequentialPool;
#[cfg(all(feature = "std", feature = "wasm", target_arch = "wasm32"))]
pub(crate) fn global_pool() -> DefaultPool {
&PERSISTENT_POOL
}
#[cfg(all(
feature = "std",
feature = "persistent-pool-rayon",
not(all(feature = "wasm", target_arch = "wasm32")),
))]
pub(crate) fn global_pool() -> DefaultPool {
&PERSISTENT_POOL
}
#[cfg(all(
feature = "std",
feature = "transient-pool",
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
))]
pub(crate) fn global_pool() -> DefaultPool {
&PERSISTENT_POOL
}
#[cfg(all(
feature = "std",
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
not(feature = "transient-pool"),
))]
pub(crate) fn global_pool() -> DefaultPool {
&PERSISTENT_POOL
}
#[cfg(all(
not(feature = "std"),
not(all(feature = "wasm", target_arch = "wasm32")),
not(feature = "persistent-pool-rayon"),
not(feature = "transient-pool"),
))]
pub(crate) fn global_pool() -> DefaultPool {
&PERSISTENT_POOL
}