-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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> { ... }
}
Steps / History
- ACP: Add
get
,set
andreplace
methods toMutex
andRwLock
libs-team#485 - Implementation: Add value accessor methods to
Mutex
andRwLock
#133406 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Whether we should checking poisoning first and avoid unnecessary lock acquire attempts.
Links
Footnotes
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.