tree: 1c20e98a12ea483857ff21c5c3c8fe78db8daf95 [path history] [tgz]
  1. avr-specs/
  2. src/
  3. .cargo-checksum.json
  4. BUILD.bazel
  5. build.rs
  6. Cargo.toml
  7. CHANGELOG.md
  8. ci.sh
  9. LICENSE-APACHE
  10. LICENSE-MIT
  11. README.md
  12. rust-toolchain.toml
crates/vendor/atomic-polyfill-0.1.11/README.md

atomic-polyfill

Documentation

This crate polyfills atomics on targets where they're not available, using critical sections. It is intended to be a drop-in replacement for core::sync::atomic.

There are two “levels” of polyfilling:

  • Native: No polyfilling is performed, the native core::sync::atomic::AtomicXX is reexported.
  • 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.

Target support

The right polyfill level is automatically picked based on the target and the atomic width:

TargetLevelLevel for u64/i64
thumbv4tFullFull
thumbv6mFullFull
thumbv7*, thumbv8*NativeFull
riscv32imcFullFull
riscv32imacNativeFull
xtensa-*-espidfNativeNative
xtensa-esp32-*NativeFull
xtensa-esp32s2-*FullFull
xtensa-esp32s3-*NativeFull
xtensa-esp8266-*FullFull
AVRFullFull

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.

License

This work is licensed under either of

at your option.

Contribution

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.