NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #863 most downloaded on crates.io
Cross-platform critical section
Last release 4 months ago
09 Jun 2026
Release timing varies
gaps range from 2 weeks to 1.6 years
Nearly every release is documented
notes for 1 of 1 stable releases
18 versions withdrawn
withdrawn after publishing
5 years old
19 releases · first in 2021
One column per quarter.
Add support for `loom` critical sections (using cfg(loom)) to the std implementation. #58
Soundness fix: ensure the CriticalSection token is not Send or Sync, so that it can only be used in the thread that acquired it. #55
Added option to use a usize sized restore state
usize sized restore stateClarified that acquire() must provide ordering guarantees
acquire() must provide ordering guaranteesMutex example27: Release v1.1.1 r=eldruin a=Dirbaio
27: Release v1.1.1 r=eldruin a=Dirbaio
Co-authored-by: Dario Nieuwenhuis dirbaio@dirbaio.net
std implementation, panicking inside the critical_section::with() closure no longer accidentally leaves the critical section locked (#26).23: Release v1.1 r=eldruin a=Dirbaio
23: Release v1.1 r=eldruin a=Dirbaio
Co-authored-by: Dario Nieuwenhuis dirbaio@dirbaio.net
std::sync::Mutex, enabled by the std Cargo feature.1.54 when std feature is disabled, 1.63 when enabled.21: Rename doctest from GH_6 and make it cfg(doctest) r=Dirbaio a=jannic
21: Rename doctest from GH_6 and make it cfg(doctest) r=Dirbaio a=jannic
Co-authored-by: Jan Niehusmann jan@gondor.com
Change name of the extern fns to avoid clash with critical-section 0.2.
extern fns to avoid clash with critical-section 0.2.Removed all builtin impls. These are going to be provided by platform-support crates now.
Breaking changes:
custom_impl! to set_impl!.RawRestoreState type alias for impl writers.(). (previously it was fixed to u8.)CriticalSection and Mutex types, instead of reexporting them from bare_metal.Those breaking changes are necessary because versions <= 0.2.7 were unsound, and that was impossible to fix without a breaking change.
Breaking changes:
acquire and release are only implemented if the restore-state used by
version 1.1.1 is an u8 or smaller.Those breaking changes are necessary because versions <= 0.2.7 were unsound, and that was impossible to fix without a breaking change.
This version is meant to minimize that breaking change. However, all users are encouraged to upgrade to critical-section 1.1.
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.
- Add support for AVR targets.
- Improved docs.
Fix std implementation to allow reentrant (nested) critical sections. This would previously deadlock.
std implementation to allow reentrant (nested) critical sections. This would previously deadlock.Add support for 32bit RISC-V targets.
Use correct #[vcfg] for wasm targets.
#[vcfg] for wasm targets.Added support for wasm targets.
wasm targets.Added critical section implementation for std, based on a global Mutex.
std, based on a global Mutex.Breaking change: use CriticalSection<'_> instead of &CriticalSection<'_>
CriticalSection<'_> instead of &CriticalSection<'_>[Unreleased]: https://github.com/rust-embedded/critical-section/compare/v1.3.0...HEAD [v1.3.0]: https://github.com/rust-embedded/critical-section/comp
Your coding agent can read these notes before it upgrades. Set up the MCP server →