rust-lang / rust-lang/rust

Tracking Issue for Unlockable Guards

Open
#148,568 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue S-tracking-unimplemented T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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
  • ACP: rust-lang/libs-team#679
  • Implementation: #...
  • Final comment period (FCP)^1
  • Stabilization PR
Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proposed APIs under std::sync::nonpoison::mutex and std::sync::nonpoison::rwlock, then read ACP rust-lang/libs-team#679. The implementation, final comment period, and stabilization steps are still unchecked; completion requires progressing those tracked stages.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.