Expand description
Simple synchronization primitives (SpinLock, Once) for no_std environments.
Minimal synchronization primitives for no_std kernels.
These primitives are intentionally simple and are meant as building blocks. They are not a full-featured synchronization library.
§Important caveats
- No fairness guarantees: spin locks may starve.
- Not preemption-safe by themselves: if your kernel is preemptive or can be interrupted, you may need to disable interrupts or otherwise ensure lock-holding sections are safe.
- Single-core vs multi-core: on SMP systems, these use atomics and are safe provided your platform’s memory model matches Rust’s atomic semantics.
Structs§
- Once
- A minimal, spin-based
Onceinitializer. - Spin
Lock - A simple spin lock.
- Spin
Lock Guard - RAII guard returned by
SpinLock::lock.