Skip to main content

Module sync

Module sync 

Source
Expand description

Synchronization primitives working across std, no-std and wasm environments.

Modules§

reentrant
Re-entrant locking primitives, available in std environments.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
Lazy
A value which is initialized on the first access.
Mutex
A mutual exclusion primitive useful for protecting shared data
RwLock
A reader-writer lock which is exclusively locked for writing or shared for reading. This reader-writer lock will block threads waiting for the lock to become available. The lock can also be statically initialized or created via a RwLock::new RwLock wrapper to make spin::RwLock API compatible with std::sync::RwLock to swap
RwLockReadGuard
RAII structure used to release the shared read access of a lock when dropped.
RwLockWriteGuard
RAII structure used to release the exclusive write access of a lock when dropped.
SyncOnceCell
A cell that provides lazy one-time initialization that implements Sync and Send.
ThreadId
An opaque thread identifier.

Enums§

Ordering
Atomic memory orderings

Type Aliases§

AtomicBool
A boolean type which can be safely shared between threads.
AtomicU8
An integer type which can be safely shared between threads.
AtomicU32
An integer type which can be safely shared between threads.
AtomicUsize
An integer type which can be safely shared between threads.
Once
A spin-based one-time initialization cell, identical on every target.