Add portable-atomic feature and disable portable-atomic/critical-section by default #265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #264
This implements the first of the ways I mentioned in #264 (comment).
(The second way mentioned there was probably more user-friendly, but I did not choose it because it would have caused
portable-atomic
to appear in Cargo.lock as a platform-specific dependency. Like cfg-specific dependencies in crossbeam-rs/crossbeam#487 (comment).)No new test case was added, because the following case is sufficient to test the situation where the
race
module is enabled (due to default features) andportable-atomic
is used instead ofcore::sync::atomic
(due tocritical-section
feature enablesportable-atomic
feature).once_cell/xtask/src/main.rs
Line 40 in 72f7c2e
This also closes #248 since this is a sound way to do that.
cc @kaspar030 @brodycj