Skip to content

Commit

Permalink
Merge pull request #244 from Amanieu/remove-mapped-downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Jun 11, 2020
2 parents 8852b4a + 55f58b5 commit 1f6e68e
Showing 1 changed file with 0 additions and 24 deletions.
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

0 comments on commit 1f6e68e

Please sign in to comment.