All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
No unreleased changes yet
AtomicPtr
accidentally not being available when not polyfilled.critical-section
v1.0Bump critical-section
dependency from 0.2
to 1.0
.
This is a breaking change if you were relying on the default implementations available on critical-section 0.2.7
and earlier. They have been removed in critical-section 0.2.8
because they were unsound, since there‘s no way to guarantee they’re correct for the target in use (for example for multi-core embedded targets). Since critical-section 0.2.8
just forwards to 1.0
now, we decided to change atomic-polyfill
to use 1.0
directly.
If you‘re seeing a linker error like undefined symbol: _critical_section_1_0_acquire
, you’re affected. To fix it:
If your target supports std
: Add the critical-section
dependency to Cargo.toml
enabling the std
feature.
[dependencies] critical-section = { version = "1.1", features = ["std"]}
For single-core Cortex-M targets in privileged mode:
[dependencies] cortex-m = { version = "0.7.6", features = ["critical-section-single-core"]}
For single-hart RISC-V targets in privileged mode:
[dependencies] riscv = { version = "0.10", features = ["critical-section-single-hart"]}
For other targets: check if your HAL or architecture-support crate has a critical-section 1.0
implementation available. Otherwise, provide your own.
AtomicPtr
accidentally not being available when not polyfilled.The “CAS” level which uses atomic load/store and critical-section based CAS was not sound, because critical-section
guarantees only “no other critical section can run concurrently”, not “no other code can run concurrently”. Therefore a CS-based CAS can still race a native atomic store.
core::sync::atomic::*
as-is for unknown targets, to avoid build failures if they don't have full atomic support.thumbv4t
targets. (Nintendo Game Boy Advance)get_mut()
to AtomicBool
.into_inner()
to all atomicsfmt::Debug
impl to AtomicBool
, AtomicPtr
.fmt::Pointer
impl to AtomicPtr
.From<*mut T>
impl to AtomicPtr
.RefUnwindSafe
impl to all atomics.std
implementation to allow reentrant (nested) critical sections. This would previously deadlock.AtomicU64
, AtomicI64
.cortex-m
when needed (#4)fetch_update
due to incorrect ordering (#5)fence
and compiler_fence
in polyfilled mode.