Module atomic

Source
Expand description

Re-export portable atomic.

Although core contains a sync::atomic module, these are dependent on the target having atomic instructions, and the types are missing when the platform cannot support them. Zephyr, however, does provide atomics on platforms that don’t support atomic instructions, using spinlocks. In the Rust-embedded world, this is done through the portable-atomic crate, which will either just re-export the types from core, or provide an implementation using spinlocks when those aren’t available.

Modules§

hint
Re-export of the core::hint module.

Macros§

cfg_has_atomic_8
cfg_has_atomic_16
cfg_has_atomic_32
cfg_has_atomic_64
cfg_has_atomic_128
cfg_has_atomic_cas
cfg_has_atomic_ptr
cfg_no_atomic_8
cfg_no_atomic_16
cfg_no_atomic_32
cfg_no_atomic_64
cfg_no_atomic_128
cfg_no_atomic_cas
cfg_no_atomic_ptr

Structs§

AtomicBool
A boolean type which can be safely shared between threads.
AtomicI8
An integer type which can be safely shared between threads.
AtomicI16
An integer type which can be safely shared between threads.
AtomicI32
An integer type which can be safely shared between threads.
AtomicI64
An integer type which can be safely shared between threads.
AtomicI128
An integer type which can be safely shared between threads.
AtomicIsize
An integer type which can be safely shared between threads.
AtomicPtr
A raw pointer type which can be safely shared between threads.
AtomicU8
An integer type which can be safely shared between threads.
AtomicU16
An integer type which can be safely shared between threads.
AtomicU32
An integer type which can be safely shared between threads.
AtomicU64
An integer type which can be safely shared between threads.
AtomicU128
An integer type which can be safely shared between threads.
AtomicUsize
An integer type which can be safely shared between threads.

Enums§

Ordering
Atomic memory orderings

Functions§

compiler_fence
A “compiler-only” atomic fence.
fence
An atomic fence.