Module sync

Source
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§

atomic
Re-export portable atomic.
channel
Close-to-Zephyr channels

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
Condvar
Inspired by std::sync::Condvar, implemented directly using z_condvar in Zephyr.
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 (faslls out of scope), the lock will be unlocked.
PinWeak
Safe Pinned Weak references.
SpinMutex
A lower-level mutual exclusion primitive for protecting data.
SpinMutexGuard
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 of Arc that holds a non-owning reference to the managed allocation. The allocation is accessed by calling upgrade on the Weak pointer, which returns an Option<Arc<T>>.

Enums§

TryLockError
An enumeration of possible errors associated with a TryLockResult.

Type Aliases§

LockResult
Until poisoning is implemented, mutexes never return an error, and we just get back the guard.
TryLockResult
The return type from Mutex::try_lock.