bevy_platform/sync/
mod.rs

1//! Provides various synchronization alternatives to language primitives.
2//!
3//! Currently missing from this module are the following items:
4//! * `Condvar`
5//! * `WaitTimeoutResult`
6//! * `mpsc`
7//!
8//! Otherwise, this is a drop-in replacement for `std::sync`.
9
10pub use barrier::{Barrier, BarrierWaitResult};
11pub use lazy_lock::LazyLock;
12pub use mutex::{Mutex, MutexGuard};
13pub use once::{Once, OnceLock, OnceState};
14pub use poison::{LockResult, PoisonError, TryLockError, TryLockResult};
15pub use rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
16
17#[cfg(feature = "alloc")]
18pub use arc::{Arc, Weak};
19
20pub mod atomic;
21
22mod barrier;
23mod lazy_lock;
24mod mutex;
25mod once;
26mod poison;
27mod rwlock;
28
29#[cfg(all(feature = "alloc", not(target_has_atomic = "ptr")))]
30use portable_atomic_util as arc;
31
32#[cfg(all(feature = "alloc", target_has_atomic = "ptr"))]
33use alloc::sync as arc;