Skip to content

Tracking Issue for Mutex::unlock() #81872

Closed

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<T> Mutex<T> {
    /// Immediately drops the guard, unlocking the mutex.
    ///
    /// This is equivalent to `drop(guard)`, but it is more self-documenting.
    pub fn unlock(guard: MutexGuard<T>) {
        drop(guard);
    }
}

Steps / History

Unresolved Questions

  • Should an analogous function be added to RwLock? It would be a bit more complicated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions