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
- Mutex
Guard - 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
- RwLock
Read Guard - RAII structure used to release the shared read access of a lock when dropped.
- RwLock
Write Guard - 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