Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/crates/bevy_platform/src/sync/mod.rs
6849 views
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
10
pub use barrier::{Barrier, BarrierWaitResult};
11
pub use lazy_lock::LazyLock;
12
pub use mutex::{Mutex, MutexGuard};
13
pub use once::{Once, OnceLock, OnceState};
14
pub use poison::{LockResult, PoisonError, TryLockError, TryLockResult};
15
pub use rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
16
17
crate::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
29
pub mod atomic;
30
31
mod barrier;
32
mod lazy_lock;
33
mod mutex;
34
mod once;
35
mod poison;
36
mod rwlock;
37
38