atomic-polyfill
Atomic polyfills, for targets where they're not available.
1.0.3
25M downloads/mo
#1868 most downloaded on crates.io
embassy-rs/atomic-polyfill
What this package is like to depend on
Last release 3 years ago
no release in 18 months
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 1 of 1 stable releases
15 versions withdrawn
withdrawn after publishing
5 years old
16 releases · first in 2021
0 releases in the last 12 months
see the full history below
Release timeline
16 releases · Mar 2021 to Jul 2023Releases
latest 16-
1.0.311 Jul 2023 -
1.0.212 Mar 2023 withdrawn -
1.0.112 Aug 2022 withdrawn -
1.0.011 Aug 2022 withdrawn -
0.1.1129 Nov 2022 withdrawnRelease notes
Open source →-
Bump
critical-sectiondependency from0.2to1.0.This is a breaking change if you were relying on the default implementations available on
critical-section 0.2.7and earlier. They have been removed incritical-section 0.2.8because 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). Sincecritical-section 0.2.8just forwards to1.0now, we decided to changeatomic-polyfillto use1.0directly.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 thecritical-sectiondependency toCargo.tomlenabling thestdfeature.[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.0implementation available. Otherwise, provide your own.
-
-
-
0.1.1012 Aug 2022 withdrawn -
0.1.911 Aug 2022 withdrawnRelease notes
Open source →- Switch to only two polyfill levels.
The "CAS" level which uses atomic load/store and critical-section based CAS was not sound, because
critical-sectionguarantees 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. -
0.1.812 Apr 2022 withdrawn -
0.1.722 Mar 2022 withdrawnRelease notes
Open source →- Added support for xtensa (ESP chips), with and without ESP-IDF.
- Reexport
core::sync::atomic::*as-is for unknown targets, to avoid build failures if they don't have full atomic support.
-
0.1.608 Feb 2022 withdrawnRelease notes
Open source →- Add polyfill support for
thumbv4ttargets. (Nintendo Game Boy Advance) - Added
get_mut()toAtomicBool. - Added
into_inner()to all atomics - Added
fmt::Debugimpl toAtomicBool,AtomicPtr. - Added
fmt::Pointerimpl toAtomicPtr. - Added
From<*mut T>impl toAtomicPtr. - Added
RefUnwindSafeimpl to all atomics.
- Add polyfill support for
-
0.1.502 Nov 2021 withdrawnRelease notes
Open source →- Updated critical-section to v0.2.5. Fixes
stdimplementation to allow reentrant (nested) critical sections. This would previously deadlock.
- Updated critical-section to v0.2.5. Fixes
-
0.1.424 Sep 2021 withdrawnRelease notes
Open source →- Added support for RISC-V.
- Added support for "full polyfill" level, where load/stores are polyfilled, not just CAS operations.
- Added support for
AtomicU64,AtomicI64.
-
0.1.307 Aug 2021 withdrawnRelease notes
Open source →- Only import
cortex-mwhen needed (#4) - Fix panic on
fetch_updatedue to incorrect ordering (#5)
- Only import
-
0.1.228 Mar 2021 withdrawn -
0.1.104 Mar 2021 withdrawnRelease notes
Open source →- Added polyfills for AtomicU8, AtomicU16, AtomicUsize, AtomicI8, AtomicI16, AtomicI32, AtomicIsize
-
0.1.004 Mar 2021 withdrawn