Skip to main content

Module sync

Module sync 

Source
Expand description

Synchronization mechanisms for concurrent work.

sync

Extends: std::{sync}


Modules§

mpsc
Multi-producer, single-consumer channels.

Structs§

Barrier
🧵 std Enables multiple threads to synchronize the beginning of some computation.
BarrierWaitResult
🧵 ⚖️ std Returned by Barrier::wait() when all threads in it have rendezvoused.
Condvar
🧵 std A Condition Variable.
LazyLock
🧵 🌱 std A value which is initialized on the first access.
Mutex
🧵 std A mutual exclusion primitive useful for protecting shared data.
MutexGuard
🧵 🔒 std An RAII implementation of a “scoped lock” of a mutex.
Once
🧵 std A synchronization primitive for one-time global initialization.
OnceLock
🧵 std A synchronization primitive which can be written to only once.
OnceState
🧵 std State yielded to Once::call_once_force()’s closure parameter.
PoisonError
🧵 🚩 std A type of error which can be returned whenever a lock is acquired.
RwLock
🧵 std A reader-writer lock
RwLockReadGuard
🧵 std RAII structure used to release the shared read access of a lock when dropped.
RwLockWriteGuard
🧵 std RAII structure used to release the exclusive write access of a lock when dropped.
WaitTimeoutResult
🧵 ⚖️ std Whether a timed wait on a Condvar returned due to a time out or not.

Enums§

TryLockError
🧵 🚩+ std An enumeration of possible errors associated with a TryLockResult.

Type Aliases§

LockResult
🧵 ⚖️ std A type alias for the result of a lock method which can be poisoned.
TryLockResult
🧵 ⚖️ std A type alias for the result of a nonblocking locking method.