Expand description
Atomic shim: loom::sync::atomic under permutation testing, otherwise
core::sync::atomic — or, on a target with no native RMW atomics (see
the atomics-polyfill feature), portable_atomic instead (plan.md
§1.3).
The lock-free core (waker, sync/semaphore, sync/channel,
preempt/tcb) is written against this module. Under normal builds
(--cfg loom absent, atomics-polyfill off) this is a zero-cost
alias of the core atomics; with RUSTFLAGS='--cfg loom' the same code
compiles against loom’s atomics, letting the models in tests/loom.rs
explore every interleaving of the Acquire/Release orderings that are
otherwise justified only by prose comments. With atomics-polyfill on
(ARMv6-M boards — no LDREX/STREX, so core’s AtomicU32 etc. don’t
even have compare_exchange/fetch_or/swap on that target),
portable_atomic provides the identical API via a critical-section-
guarded fallback — every call site elsewhere in this crate is
unaffected either way.
Structs§
- Atomic
Experimental - A memory location which can be safely modified from multiple threads.
Enums§
- Ordering
- Atomic memory orderings
Constants§
- ATOMIC_
BOOL_ INIT Deprecated - An
AtomicBoolinitialized tofalse. - ATOMIC_
ISIZE_ INIT Deprecated - An
AtomicIsizeinitialized to0. - ATOMIC_
USIZE_ INIT Deprecated - An
AtomicUsizeinitialized to0.
Traits§
- Atomic
Primitive Experimental - A marker trait for primitive types which can be modified atomically.
Functions§
- compiler_
fence - An atomic fence for synchronization within a single thread.
- fence
- An atomic fence.
- spin_
loop_ hint Deprecated - Signals the processor that it is inside a busy-wait spin-loop (“spin lock”).
Type Aliases§
- Atomic
Bool - A boolean type which can be safely shared between threads.
- Atomic
I8 - An integer type which can be safely shared between threads.
- Atomic
I16 - An integer type which can be safely shared between threads.
- Atomic
I32 - An integer type which can be safely shared between threads.
- Atomic
I64 - An integer type which can be safely shared between threads.
- Atomic
Isize - An integer type which can be safely shared between threads.
- Atomic
Ptr - A raw pointer type which can be safely shared between threads.
- Atomic
U8 - An integer type which can be safely shared between threads.
- Atomic
U16 - An integer type which can be safely shared between threads.
- Atomic
U32 - An integer type which can be safely shared between threads.
- Atomic
U64 - An integer type which can be safely shared between threads.
- Atomic
Usize - An integer type which can be safely shared between threads.