Skip to main content

Crate async_priority_lock

Crate async_priority_lock 

Source
Expand description

§Async Priority Lock

Primitive for priority-based locking of resources. Locks are granted in order of priority, with the option for lock holders to allow for eviction (via evict flag).

Note that this is a “California eviction” - the holder is requested to release the lock, but it’s up to the holder of the guard to listen (via .evicted()) and release the lock.

For no-std environments, the no-std feature can be enabled (although alloc is still needed).

Structs§

PriorityMutex
A mutex that distributes access by priority as opposed to just fifo / whoever gets it first. If fifo isn’t set, the current behavior is lifo - however this is may not always be the case. Having fifo = false means it doesn’t matter the order of items with the same priority (instead, they will be queued in whichever order is fastest - currently, lifo)
PriorityMutexGuard
TryLockError
Opaque marker type for try_lock result

Type Aliases§

FIFOPriorityMutex
LowestFirstPriorityMutex