Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ std = []
# Enables async receiving via the AsyncReceiver receiver
async = []

[dependencies]
# Use portable-atomic crate to support platforms without atomic CAS.
# Enable require-cas feature to provide an error message if dependents require atomic CAS but the end user forgets to use single-core cfg or critical-section feature.
extra-platforms = { package = "portable-atomic", version = "1.3", optional = true, default-features = false, features = ["require-cas"] }

# Only used for internal correctness testing.
# Downstream users of oneshot should never enable this feature. Enabling it does nothing.
# To compile oneshot built against loom one must *also* set RUSTFLAGS="--cfg oneshot_loom"
Expand Down
4 changes: 3 additions & 1 deletion src/atomic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#[cfg(not(oneshot_loom))]
#[cfg(not(any(oneshot_loom, feature = "extra-platforms")))]
pub use core::sync::atomic::{AtomicU8, Ordering, fence};
#[cfg(feature = "extra-platforms")]
pub use extra_platforms::{AtomicU8, Ordering, fence};
#[cfg(oneshot_loom)]
pub use loom::sync::atomic::{AtomicU8, Ordering, fence};