Skip to main content

Module sync

Module sync 

Source
Expand description

Synchronization primitives

Windjammer’s sync module provides thread-safe synchronization primitives with simplified error handling and ergonomic APIs.

Modules§

mpsc
Multi-producer, single-consumer FIFO queue communication primitives.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
Condvar
A Condition Variable
Mutex
A mutual exclusion primitive useful for protecting shared data
MutexGuard
An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
Once
A low-level synchronization primitive for one-time global execution.
RwLock
A reader-writer lock
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.

Functions§

arc
Create a new Arc
arc_mutex
Create a new Arc<Mutex>
arc_rwlock
Create a new Arc<RwLock>
channel
Create a channel
lock
Lock a mutex, panicking on poison
mutex
Create a new Mutex
read
Read lock an RwLock
rwlock
Create a new RwLock
sync_channel
Create a bounded channel
try_lock
Try to lock a mutex
try_read
Try to read lock an RwLock
try_write
Try to write lock an RwLock
write
Write lock an RwLock