mvdnes / spin-rs

Spin-based synchronization primitives
MIT License
485 stars 92 forks source link

Enable portable-atomic's require-cas feature #152

Closed taiki-e closed 1 year ago

taiki-e commented 1 year ago

This provides a better error message if the end user forgets to use the cfg or feature. (Also allows using the critical-section feature instead of the cfg.)

$ cargo build --target thumbv6m-none-eabi --no-default-features --features spin_mutex,portable_atomic
   Compiling portable-atomic v1.3.2
error: dependents require atomic CAS but not available on this target by default;
       consider using portable_atomic_unsafe_assume_single_core cfg or critical-section feature.
       see <https://docs.rs/portable-atomic/latest/portable_atomic/#optional-cfg> for more.

This also reverts the following commits (partially):

zesterer commented 1 year ago

Thanks, this is great! I really appreciate the time you've put into this.