Skip to content

Tracking Issue for Unlockable Guards #148568

@SpaceBroetchen

Description

@SpaceBroetchen

Feature gate: #![feature(unlockable_guards)]

This is a tracking issue for unlocking nonpoison guards temporary while only holding a mutable reference to them.

Public API

// std::sync::nonpoison::mutex

#[unstable(feature = "unlockable_guards", issue = "148568")]
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
impl<T: ?Sized> MutexGuard<'_, T> {
    pub fn unlocked<F>(self: &mut Self, func: F) where F: FnOnce() -> ();
}
// std::sync::nonpoison::rwlock

#[unstable(feature = "unlockable_guards", issue = "148568")]
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
impl<T: ?Sized> RwLockWriteGuard<'_, T> {
    pub fn unlocked<F>(self: &mut Self, func: F) where F: FnOnce() -> ();
}

#[unstable(feature = "unlockable_guards", issue = "148568")]
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
impl<T: ?Sized> RwLockReadGuard<'_, T> {
    pub fn unlocked<F>(self: &mut Self, func: F) where F: FnOnce() -> ();
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions