Skip to content
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

Remove deprecated and unsound MappedRwLockWriteGuard::downgrade #244

Merged
merged 1 commit into from
Jun 11, 2020
Merged
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
24 changes: 0 additions & 24 deletions lock_api/src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1559,30 +1559,6 @@ impl<'a, R: RawRwLock + 'a, T: ?Sized + 'a> MappedRwLockWriteGuard<'a, R, T> {
}
}

impl<'a, R: RawRwLockDowngrade + 'a, T: ?Sized + 'a> MappedRwLockWriteGuard<'a, R, T> {
/// Atomically downgrades a write lock into a read lock without allowing any
/// writers to take exclusive access of the lock in the meantime.
///
/// Note that if there are any writers currently waiting to take the lock
/// then other readers may not be able to acquire the lock even if it was
/// downgraded.
#[deprecated(
since = "0.3.3",
note = "This function is unsound and will be removed in the future, see issue #198"
)]
pub fn downgrade(s: Self) -> MappedRwLockReadGuard<'a, R, T> {
s.raw.downgrade();
let raw = s.raw;
let data = s.data;
mem::forget(s);
MappedRwLockReadGuard {
raw,
data,
marker: PhantomData,
}
}
}

impl<'a, R: RawRwLockFair + 'a, T: ?Sized + 'a> MappedRwLockWriteGuard<'a, R, T> {
/// Unlocks the `RwLock` using a fair unlock protocol.
///
Expand Down