Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tracking Issue for lock_value_accessors #133407

Copy link
Copy link
@EFanZh

Description

@EFanZh
Issue body actions

Feature gate: #![feature(lock_value_accessors)]

This is a tracking issue for feature lock_value_accessors.

Public API

impl<T> Mutex<T> {
    pub fn get_cloned(&self) -> Result<T, PoisonError<()>> where T: Clone { ... }
    pub fn set(&self, value: T) -> Result<(), PoisonError<T>> { ... }
    pub fn replace(&self, value: T) -> LockResult<T> { ... }
}

impl<T> RwLock<T> {
    pub fn get_cloned(&self) -> Result<T, PoisonError<()>> where T: Clone { ... }
    pub fn set(&self, value: T) -> Result<(), PoisonError<T>> { ... }
    pub fn replace(&self, value: T) -> LockResult<T> { ... }
}

impl<T> nonpoison::Mutex<T>
where
    T: ?Sized
{
    pub fn with_mut<F, R>(&self, f: F) -> R where F: FnOnce(&mut T) -> R { ... }
}

impl<T> nonpoison::RwLock<T>
where
    T: ?Sized
{
    pub fn with<F, R>(&self, f: F) -> R where F: FnOnce(&T) -> R { ... }
    pub fn with_mut<F, R>(&self, f: F) -> R where F: FnOnce(&mut T) -> R { ... }
}

Steps / History

Unresolved Questions

  • Whether we should checking poisoning first and avoid unnecessary lock acquire attempts.

Links

Footnotes

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

kornelski and Enduriel

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.