-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Implementation: #[feature(nonpoison_rwlock)]
#144648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This commit is a purely cosmetic change to the documentation and ordering of items in the `rwlock.rs` file, which will help discern the actual difference between the `nonpoison` and `poison` variants of `rwlock`. List of changes (lots of small things): - Clean up some of the existing field doc comments - Add documentation for every field in struct definitions - Consolidate related implementation blocks (1 implementation block per guard instead of 2) - Use the lifetime name `'rwlock` instead of `'a` - Reorder implementation blocks to be consistent across the entire file (follows the order `ReadGuard`, `WriteGuard`, `MappedReadGuard`, MappedWriteGuard`) - Move simple trait implementations to the bottom of the file - Rename the `poison` field in `MappedRwLockWriteGuard` to posion_guard` - Cut off comments at 100 columns - Update the documentation of `downgrade` to match stabilization PR # 143191
rustbot has assigned @Mark-Simulacrum. Use |
This comment has been minimized.
This comment has been minimized.
135e052
to
3bdfb3a
Compare
Adds the equivalent `nonpoison` types to the `poison::rwlock` module. These types and implementations are gated under the `nonpoison_rwlock` feature gate. Also blesses the ui tests that now have a name conflicts (because these types no longer have unique names). The full path distinguishes the different types.
This commit simply helps discern the actual changes needed to test both poison and nonpoison `rwlock`s.
Adds tests for the `nonpoison::RwLock` 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.
3bdfb3a
to
21a0262
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: since this is a large file, it might be good to compare this directly with the poison::rwlock
module (with the additional reorganizations made in the first commit)
(for copy paste)
delta library/std/src/sync/poison/rwlock.rs library/std/src/sync/nonpoison/rwlock.rs
diff library/std/src/sync/poison/rwlock.rs library/std/src/sync/nonpoison/rwlock.rs
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 existingpoison::rwlock
file that hopefully makes both variants more readable.Related PRs
nonpoison_condvar
implementation: Implementation:#[feature(nonpoison_condvar)]
#144651nonpoison_once
implementation: Implementation:#[feature(nonpoison_once)]
#144653