wgpu-sync: Add once_cell

Centralizes configuration of `once_cell` and avoids duplicating fallback logic across crates.
This commit is contained in:
Zac Harrold authored and Kevin Reid committed 2026-08-19 08:16:01 -07:00
1 parent 1877640a73
commit 63730c440d
3 files changed
+16 -2

No files matched your search

Generated
+1
View File
@@ -5037,6 +5037,7 @@ version = "30.0.0"
dependencies = [
"cfg-if",
"lock_api",
"once_cell",
"parking_lot",
]
+3 -2
View File
@@ -29,10 +29,11 @@ alloc_instead_of_core = "warn"
[features]
default = ["std"]
std = ["alloc", "dep:parking_lot"]
alloc = []
std = ["alloc", "dep:parking_lot", "once_cell/std"]
alloc = ["once_cell/alloc"]
[dependencies]
cfg-if.workspace = true
lock_api = { workspace = true, default-features = false }
parking_lot = { workspace = true, optional = true }
once_cell = { workspace = true, default-features = false, features = ["race"] }
+12
View File
@@ -28,6 +28,18 @@ pub use rwlock::RawRwLock;
#[cfg(feature = "std")]
pub use parking_lot::{Condvar, Mutex as CondvarMutex};
#[cfg(feature = "alloc")]
pub use once_cell::race::OnceBox;
pub use once_cell::race::{OnceBool, OnceNonZeroUsize, OnceRef};
cfg_if::cfg_if! {
if #[cfg(feature = "std")] {
pub use once_cell::sync::{Lazy, OnceCell};
} else {
pub use once_cell::unsync::{Lazy, OnceCell};
}
}
/// A [`Mutex`](lock_api::Mutex) using [`RawMutex`] for its backing implementation.
pub type Mutex<T> = lock_api::Mutex<RawMutex, T>;