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_condvar
in 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
Weak
is a version ofArc
that holds a non-owning reference to the managed allocation. The allocation is accessed by callingupgrade
on theWeak
pointer, 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
.