Available on crate feature
full only.Expand description
Provides kernel synchronisation primitives.
§Overview
The following is an overview of the available synchronisation objects:
Spinlock: Provides mutual exclusion by busy-waiting until the protected resource is available.RwSpinlock: An alternative to a plainSpinlockwhich allows for multiple concurrent readers, which can be more efficient for read-heavy workloads.IrqCell: A single-threaded mutual exclusion primitive, similar toRefCell, which attempts to reduce deadlocks by disabling interrupts while locked.OnceLock: Used for thread-safe, one-time initialization of a variable, with potentially different initializers based on the caller.LazyLock: Used for thread-safe, one-time initialization of a variable, using one nullary initializer function provided at creation.
Structs§
- IrqCell
Non- use_std - An interrupt safe, single-threaded mutable memory location.
- IrqGuard
Non- use_std - An RAII implementation of a “scoped lock” of an
IrqCell. When this structure is dropped (falls out of scope), the lock will be unlocked. - Lazy
Lock Non- use_std - A value which is initialized on the first access.
- Once
Non- use_std - A low-level synchronization primitive for one-time global execution.
- Once
Lock Non- use_std - A synchronization primitive which can nominally be written to only once.
Traits§
- Spinlock
Guard Ext Non- use_std - Extension functions to
SpinlockGuard.
Type Aliases§
- Mapped
Spinlock Guard Non- use_std - An RAII spinlock guard returned by
SpinlockGuard::map, which can point to a subfield of the protected data. - RwRead
Guard Non- use_std - RAII structure used to release the shared read access of a lock when dropped.
- RwSpinlock
Non- use_std - A reader-writer lock.
- RwUpgradable
Read Guard Non- use_std - RAII structure used to release upgradable read access of a lock when dropped.
- RwWrite
Guard Non- use_std - RAII structure used to release the exclusive write access of a lock when dropped.
- Spinlock
Non- use_std - A mutual exclusion primitive useful for protecting shared data.
- Spinlock
Guard Non- use_std - An RAII implementation of a “scoped lock” of a spinlock. When this structure is dropped (falls out of scope), the lock will be unlocked.