Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stabilize rwlock_downgrade library feature #143191

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

Open
connortsui20 wants to merge 1 commit into rust-lang:master
base: master
Choose a base branch
Loading
from connortsui20:stabilize-rwlock-downgrade
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions library/std/src/sync/nonpoison/rwlock.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
///
/// ```
/// #![feature(nonpoison_rwlock)]
/// #![feature(rwlock_downgrade)]
///
/// use std::sync::nonpoison::{RwLock, RwLockWriteGuard};
///
Expand All @@ -657,7 +656,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
///
/// ```
/// #![feature(nonpoison_rwlock)]
/// #![feature(rwlock_downgrade)]
///
/// use std::sync::Arc;
/// use std::sync::nonpoison::{RwLock, RwLockWriteGuard};
Expand Down Expand Up @@ -690,8 +688,7 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
/// # let final_check = rw.read();
/// # assert_eq!(*final_check, 3);
/// ```
#[unstable(feature = "rwlock_downgrade", issue = "128203")]
// #[unstable(feature = "nonpoison_rwlock", issue = "134645")]
#[unstable(feature = "nonpoison_rwlock", issue = "134645")]
pub fn downgrade(s: Self) -> RwLockReadGuard<'rwlock, T> {
let lock = s.lock;

Expand Down
6 changes: 1 addition & 5 deletions library/std/src/sync/poison/rwlock.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
/// `downgrade` takes ownership of the `RwLockWriteGuard` and returns a [`RwLockReadGuard`].
///
/// ```
/// #![feature(rwlock_downgrade)]
///
/// use std::sync::{RwLock, RwLockWriteGuard};
///
/// let rw = RwLock::new(0);
Expand All @@ -831,8 +829,6 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
/// thread calling `downgrade` and any reads it performs after downgrading.
///
/// ```
/// #![feature(rwlock_downgrade)]
///
/// use std::sync::{Arc, RwLock, RwLockWriteGuard};
///
/// let rw = Arc::new(RwLock::new(1));
Expand Down Expand Up @@ -863,7 +859,7 @@ impl<'rwlock, T: ?Sized> RwLockWriteGuard<'rwlock, T> {
/// # let final_check = rw.read().unwrap();
/// # assert_eq!(*final_check, 3);
/// ```
#[unstable(feature = "rwlock_downgrade", issue = "128203")]
#[stable(feature = "rwlock_downgrade", since = "CURRENT_RUSTC_VERSION")]
pub fn downgrade(s: Self) -> RwLockReadGuard<'rwlock, T> {
let lock = s.lock;

Expand Down
1 change: 0 additions & 1 deletion library/std/tests/sync/lib.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#![feature(once_cell_try)]
#![feature(lock_value_accessors)]
#![feature(reentrant_lock)]
#![feature(rwlock_downgrade)]
#![feature(std_internals)]
#![feature(sync_nonpoison)]
#![feature(nonpoison_mutex)]
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /