-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-atomicArea: Atomics, barriers, and sync primitivesArea: Atomics, barriers, and sync primitivesA-concurrencyArea: ConcurrencyArea: ConcurrencyC-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 RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-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(atomic_from_mut)]
Public API
impl AtomicU32 {
pub fn from_mut(v: &mut u32) -> &mut Self;
pub fn from_mut_slice(v: &mut [u32]) -> &mut [Self];
pub fn get_mut_slice(this: &mut [Self]) -> &mut [u32];
}
// And same for AtomicBool, AtomicU8, AtomicU16, AtomicU64, AtomicI8, AtomicI16, AtomicI32, AtomicI64, and AtomicPtr
Each one is gated on #[cfg(target_has_atomic_equal_alignment = "..")]
and is only available on platforms where Atomic<size>
has the same alignment as u<size>
.
Steps / History
- Implementation: Add Atomic*::from_mut. #74532
- Make
Atomic*::from_mut
return&mut Atomic*
#92671 - Add Atomic*::from_mut_slice #94384
- Add
Atomic*::get_mut_slice
#94816 - Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
Should these return— yes: Make&mut Self
instead, such that it's the exact inverse ofget_mut
?Atomic*::from_mut
return&mut Atomic*
#92671Also add— yes: Add Atomic*::from_mut_slice #94384from_mut_slice
?
finnbear, nanoqsh, AGSaidi, dgiger42, fogti and 2 morekornelski, AGSaidi and miguelfrde
Metadata
Metadata
Assignees
Labels
A-atomicArea: Atomics, barriers, and sync primitivesArea: Atomics, barriers, and sync primitivesA-concurrencyArea: ConcurrencyArea: ConcurrencyC-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 RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-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.