Closed fralalonde closed 2 years ago
Thanks for the PR! This broadly looks fine to me. Just to check: are you 100% sure that you caught all existing uses of core::sync::atomic
?
The requested changes make sense and have been applied.
I've reviewed references to core::sync::atomic
and the only occurrence is the one that is under the #[cfg(not(feature = "portable_atomic"))]
condition. References to std::sync::atomic
are confined to tests and unaffected.
Thanks for making those changes. Are you in need of this feature soon, or are you happy to wait for the next stable release?
Thanks!
I have no problem sticking to my branch until the next release.
Add optional
portable_atomic
feature to enable theportable-atomic
crate for use of emulated atomic operations on platforms that don't have them.This is in response to https://github.com/mvdnes/spin-rs/issues/114. Code changes follow closely those of previously proposed
atomic-polyfill
PR https://github.com/mvdnes/spin-rs/pull/115I've expanded a bit on the feature and its implications in the README.
Tested as working with my app (unpublished yet) - a host USB stack on Atmel SAM D21 which has a single Cortex-M0 core.
I will gladly update this PR if any changes are deemed necessary.