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
17crate::cfg::alloc! {
18    pub use arc::{Arc, Weak};
19
20    crate::cfg::arc! {
21        if {
22            use alloc::sync as arc;
23        } else {
24            use portable_atomic_util as arc;
25        }
26    }
27}
28
29pub mod atomic;
30
31mod barrier;
32mod lazy_lock;
33mod mutex;
34mod once;
35mod poison;
36mod rwlock;