Tracking Issue for Mutex::unlock() · Issue #81872 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Feature gate: #![feature(mutex_unlock)]
This is a tracking issue for the Mutex::unlock
function. The goal of this function is to replace drop(mutex_guard)
which doesn't clear express that a synchronization event is occurring.
Some earlier discussion, including a previous implementation: #79434 (comment)
Public API
// std::sync::Mutex
impl Mutex {
/// Immediately drops the guard, unlocking the mutex.
///
/// This is equivalent to drop(guard)
, but it is more self-documenting.
pub fn unlock(guard: MutexGuard) {
drop(guard);
}
}
Steps / History
- Implementation: Add Mutex::unlock #81873
- Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
- Should an analogous function be added to
RwLock
? It would be a bit more complicated.