This crate polyfills atomics on targets where they're not available, using critical sections. It is intended to be a drop-in replacement for
There are two "levels" of polyfilling:
- Native: No polyfilling is performed, the native
- Full: Both load/store and compare-and-set operations are polyfilled.
Polyfilling requires a
critical-section implementation for the current target. Check the
critical-section README for details.
The right polyfill level is automatically picked based on the target and the atomic width:
|Target||Level||Level for u64/i64|
For targets not listed above,
atomic-polyfill assumes nothing and reexports
core::sync::atomic::*. No polyfilling is done. PRs for polyfilling more targets are welcome :)
Minimum Supported Rust Version (MSRV)
MSRV is currently Rust 1.54. MSRV may be upgraded at any new patch release as long as latest stable Rust is supported.
This work is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.