Skip to content

Commit

Permalink
Rollup merge of rust-lang#121736 - HTGAzureX1212:HTGAzureX1212/remove…
Browse files Browse the repository at this point in the history
…-mutex-unlock, r=jhpratt

Remove `Mutex::unlock` Function

As of the completion of the FCP in rust-lang#81872 (comment), it has come to the conclusion to be closed.

This PR removes the function entirely in light of the above.

Closes rust-lang#81872.
  • Loading branch information
matthiaskrgr authored Mar 1, 2024
2 parents f8cb5af + a9907b1 commit 10da6c0
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions library/std/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,26 +369,6 @@ impl<T: ?Sized> Mutex<T> {
}
}

/// Immediately drops the guard, and consequently unlocks the mutex.
///
/// This function is equivalent to calling [`drop`] on the guard but is more self-documenting.
/// Alternately, the guard will be automatically dropped when it goes out of scope.
///
/// ```
/// #![feature(mutex_unlock)]
///
/// use std::sync::Mutex;
/// let mutex = Mutex::new(0);
///
/// let mut guard = mutex.lock().unwrap();
/// *guard += 20;
/// Mutex::unlock(guard);
/// ```
#[unstable(feature = "mutex_unlock", issue = "81872")]
pub fn unlock(guard: MutexGuard<'_, T>) {
drop(guard);
}

/// Determines whether the mutex is poisoned.
///
/// If another thread is active, the mutex can still become poisoned at any
Expand Down

0 comments on commit 10da6c0

Please sign in to comment.