tokio-rs / loom

Concurrency permutation testing tool for Rust.
MIT License
2.09k stars 110 forks source link

Add a `loom::hint` module containing mocked versions of `spin_loop` and `unreachable_unchecked` #197

Closed thomcc closed 3 years ago

thomcc commented 3 years ago

std::sync::atomic::spin_loop_hint is deprecated, so loom should provide the non-deprecated replacement. It just calls the deprecated version though.

I provided unreachable_unchecked too, even though it's not exactly loom's wheelhouse, but it could help catch some UB, and lets users potentially reduce the amount of cfg special-casing they need.

thomcc commented 3 years ago

Stable CI failure is a warning that's fixed by #195. (merged)

carllerche commented 3 years ago

Thanks :+1: