Expand description
Higher level synchronization primitives.
These are modeled after the synchronization primitives in
std::sync and those from
crossbeam-channel, in as much
as it makes sense.
Modules§
Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Condvar
- Inspired by
std::sync::Condvar, implemented directly usingz_condvarin Zephyr. - 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 (faslls out of scope), the lock will be unlocked.
- PinWeak
- Safe Pinned Weak references.
- Spin
Mutex - A lower-level mutual exclusion primitive for protecting data.
- Spin
Mutex Guard - An RAII implementation of a “scoped lock” of a SpinMutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
- Weak
Weakis a version ofArcthat holds a non-owning reference to the managed allocation. The allocation is accessed by callingupgradeon theWeakpointer, which returns anOption<Arc<T>>.
Enums§
- TryLock
Error - An enumeration of possible errors associated with a
TryLockResult.
Type Aliases§
- Lock
Result - Until poisoning is implemented, mutexes never return an error, and we just get back the guard.
- TryLock
Result - The return type from
Mutex::try_lock.