-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
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.
Description
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
- ACP: Add
get
,set
andreplace
methods toMutex
andRwLock
libs-team#485 - Implementation: Add value accessor methods to
Mutex
andRwLock
#133406 - Implementation: Implement non-poisoning
Mutex::with_mut
,RwLock::with
andRwLock::with_mut
#147328 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Whether we should checking poisoning first and avoid unnecessary lock acquire attempts.
Links
Footnotes
kornelski
Metadata
Metadata
Assignees
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.