Implementation: #[feature(nonpoison_once)]#144653
Implementation: #[feature(nonpoison_once)]#144653connortsui20 wants to merge 3 commits intorust-lang:masterfrom
#[feature(nonpoison_once)]#144653Conversation
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
This comment has been minimized.
This comment has been minimized.
43b1e0c to
b201b42
Compare
…ark-Simulacrum Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: rust-lang#134645 This PR continues the effort made in rust-lang#144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: rust-lang#144651 - `nonpoison_once` implementation: rust-lang#144653
…ark-Simulacrum Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: rust-lang#134645 This PR continues the effort made in rust-lang#144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: rust-lang#144651 - `nonpoison_once` implementation: rust-lang#144653
|
Sorry for the delay, I've not been keep up with reviews atm. I'll assign another reviewer. r? libs |
Rollup merge of #144648 - connortsui20:nonpoison_rwlock, r=Mark-Simulacrum Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: #134645 This PR continues the effort made in #144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: #144651 - `nonpoison_once` implementation: #144653
|
☔ The latest upstream changes (presumably #145773) made this pull request unmergeable. Please resolve the merge conflicts. |
Adds the equivalent `nonpoison` types to the `poison::once` module. These types and implementations are gated under the `nonpoison_once` feature gate. Signed-off-by: Connor Tsui <[email protected]>
Signed-off-by: Connor Tsui <[email protected]>
Both implementations require poisoning support. Signed-off-by: Connor Tsui <[email protected]>
b201b42 to
2287b60
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
There was a problem hiding this comment.
For reviewers: it might be good to compare this directly with the poison::once module.
(for copy paste)
delta library/std/src/sync/poison/once.rs library/std/src/sync/nonpoison/once.rsdiff library/std/src/sync/poison/once.rs library/std/src/sync/nonpoison/once.rs…acrum Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: rust-lang/rust#134645 This PR continues the effort made in rust-lang/rust#144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: rust-lang/rust#144651 - `nonpoison_once` implementation: rust-lang/rust#144653
…acrum Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: rust-lang/rust#134645 This PR continues the effort made in rust-lang/rust#144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: rust-lang/rust#144651 - `nonpoison_once` implementation: rust-lang/rust#144653
…ark-Simulacrum Implementation: `#[feature(nonpoison_rwlock)]` Tracking Issue: rust-lang#134645 This PR continues the effort made in rust-lang#144022 by adding the implementation of `nonpoison::rwlock`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable. ### Related PRs - `nonpoison_condvar` implementation: rust-lang#144651 - `nonpoison_once` implementation: rust-lang#144653
| #[inline] | ||
| #[unstable(feature = "nonpoison_once", issue = "134645")] | ||
| #[track_caller] | ||
| pub fn call_once<F>(&self, f: F) |
There was a problem hiding this comment.
This has the exact same behavior as the poison::Once::call_once_force method. Could that be confusing (since it is named differently but is identical)?
| /// [`call_once()`]: Once::call_once | ||
| /// [`poison::Once::wait_force`]: crate::sync::poison::Once::wait_force | ||
| #[unstable(feature = "nonpoison_once", issue = "134645")] | ||
| pub fn wait(&self) { |
There was a problem hiding this comment.
Similarly, this has the same behavior as wait_force.
There was a problem hiding this comment.
Note that there are no "new" tests here, just refactored tests for the macro
…joboet Implementation: `#[feature(nonpoison_condvar)]` Tracking Issue: rust-lang#134645 This PR continues the effort made in rust-lang#144022 by adding the implementation of `nonpoison::condvar`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. There are two other changes here. The first is that the `Barrier` implementation is migrated to use the `nonpoison::Condvar` instead of the `poison` variant. The second (which might be subject to some discussion) is that `WaitTimeoutResult` is moved up to `mod.rs`, as both `condvar` variants need that type (and I do not know if there is a better place to put it now). ### Related PRs - `nonpoison_rwlock` implementation: rust-lang#144648 - `nonpoison_once` implementation: rust-lang#144653
Rollup merge of #144651 - connortsui20:nonpoison_condvar, r=joboet Implementation: `#[feature(nonpoison_condvar)]` Tracking Issue: #134645 This PR continues the effort made in #144022 by adding the implementation of `nonpoison::condvar`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. There are two other changes here. The first is that the `Barrier` implementation is migrated to use the `nonpoison::Condvar` instead of the `poison` variant. The second (which might be subject to some discussion) is that `WaitTimeoutResult` is moved up to `mod.rs`, as both `condvar` variants need that type (and I do not know if there is a better place to put it now). ### Related PRs - `nonpoison_rwlock` implementation: #144648 - `nonpoison_once` implementation: #144653
|
I'm not sure whether it's actually worth it to add a non-poisoning variant here. Contrary to |
|
I think I'm inclined to agree (see this comment: #134645 (comment)) Should Also I'm going to close this PR and move this to the tracking issue itself. |
…joboet Implementation: `#[feature(nonpoison_condvar)]` Tracking Issue: rust-lang#134645 This PR continues the effort made in rust-lang#144022 by adding the implementation of `nonpoison::condvar`. Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. There are two other changes here. The first is that the `Barrier` implementation is migrated to use the `nonpoison::Condvar` instead of the `poison` variant. The second (which might be subject to some discussion) is that `WaitTimeoutResult` is moved up to `mod.rs`, as both `condvar` variants need that type (and I do not know if there is a better place to put it now). ### Related PRs - `nonpoison_rwlock` implementation: rust-lang#144648 - `nonpoison_once` implementation: rust-lang#144653
Tracking Issue: #134645
This PR continues the effort made in #144022 by adding the implementation of
nonpoison::once.Many of the changes here are similar to the changes made to implement
nonpoison::mutex.Note that even though there were FIXMEs for changing
OnceLockandLazyLockto use thenonpoisonvariant, that is not correct as both rely on poisoning behavior to operate correctly.Related PRs
nonpoison_rwlockimplementation: Implementation:#[feature(nonpoison_rwlock)]#144648nonpoison_condvarimplementation: Implementation:#[feature(nonpoison_condvar)]#144651