Implementation: #[feature(nonpoison_condvar)]#144651
Conversation
#[feature(nonpoison_condvar)]
…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
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::condvar` module. These types and implementations are gated under the `nonpoison_condvar` feature gate. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
|
I believe Thom has been out r? Libs |
|
Failed to set assignee to
|
|
r? libs |
Adds tests for the `nonpoison::Mutex` variant by using a macro to duplicate the existing `poison` tests. Note that all of the tests here are adapted from the existing `poison` tests. Also steals the `test_mutex_arc_condvar` test from `mutex.rs`. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Since `WaitTimeoutResult` is poison-agnostic, we want to use the same type for both variants of `Condvar`. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
de36753 to
b8ee38b
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. |
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
| /// A type indicating whether a timed wait on a condition variable returned | ||
| /// due to a time out or not. | ||
| /// | ||
| /// It is returned by the [`wait_timeout`] method. | ||
| /// | ||
| /// [`wait_timeout`]: Condvar::wait_timeout | ||
| #[derive(Debug, PartialEq, Eq, Copy, Clone)] | ||
| #[stable(feature = "wait_timeout", since = "1.5.0")] | ||
| pub struct WaitTimeoutResult(bool); |
There was a problem hiding this comment.
Not actually sure that this is the best place to put it, but I do think this is still better than leaving it in poison
There was a problem hiding this comment.
For reviewers: since this is a semi-large file, it might be good to compare this directly with the poison::condvar module (with the additional reorganizations made in the first commit)
(for copy paste)
delta library/std/src/sync/poison/condvar.rs library/std/src/sync/nonpoison/condvar.rsdiff library/std/src/sync/poison/condvar.rs library/std/src/sync/nonpoison/condvar.rs| nonpoison_and_poison_unwrap_test!( | ||
| name: test_mutex_arc_condvar, | ||
| test_body: { |
There was a problem hiding this comment.
This test was stolen from mutex.rs.
Other than that, there are no "new" tests here (just refactors to use the macro)
…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
|
@bors r+ |
Rollup of 5 pull requests Successful merges: - #143462 (fix(lib-std-fs): handle `usize` overflow in `read*`) - #144651 (Implementation: `#[feature(nonpoison_condvar)]`) - #145465 (Stabilize `array_repeat` feature) - #145776 (Optimize `.ilog({2,10})` to `.ilog{2,10}()`) - #145969 (Add Duration::from_nanos_u128) r? `@ghost` `@rustbot` modify labels: rollup
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
…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::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
Barrierimplementation is migrated to use thenonpoison::Condvarinstead of thepoisonvariant. The second (which might be subject to some discussion) is thatWaitTimeoutResultis moved up tomod.rs, as bothcondvarvariants need that type (and I do not know if there is a better place to put it now).Related PRs
nonpoison_rwlockimplementation: Implementation:#[feature(nonpoison_rwlock)]#144648nonpoison_onceimplementation: Implementation:#[feature(nonpoison_once)]#144653