mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 16:31:11 +01:00
wgpu-sync: Add once_cell
Centralizes configuration of `once_cell` and avoids duplicating fallback logic across crates.
This commit is contained in:
1 parent
1877640a73
commit
63730c440d
3 files changed
+16
-2
No files matched your search
Generated
+1
@@ -5037,6 +5037,7 @@ version = "30.0.0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"lock_api",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
|
||||
@@ -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"] }
|
||||
@@ -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>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user