From 4d93f6056824c338751f19356d33bb61ce818749 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Thu, 19 Sep 2024 00:15:03 -0400 Subject: use generic Atomic type where possible in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko --- library/std/src/sys/sync/rwlock/queue.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'library/std/src/sys/sync/rwlock') diff --git a/library/std/src/sys/sync/rwlock/queue.rs b/library/std/src/sys/sync/rwlock/queue.rs index bd15f8ee952..62f084acfd2 100644 --- a/library/std/src/sys/sync/rwlock/queue.rs +++ b/library/std/src/sys/sync/rwlock/queue.rs @@ -117,11 +117,11 @@ use crate::hint::spin_loop; use crate::mem; use crate::ptr::{self, NonNull, null_mut, without_provenance_mut}; use crate::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release}; -use crate::sync::atomic::{AtomicBool, AtomicPtr}; +use crate::sync::atomic::{Atomic, AtomicBool, AtomicPtr}; use crate::thread::{self, Thread}; /// The atomic lock state. -type AtomicState = AtomicPtr<()>; +type AtomicState = Atomic; /// The inner lock state. type State = *mut (); @@ -181,11 +181,11 @@ struct Node { tail: AtomicLink, write: bool, thread: OnceCell, - completed: AtomicBool, + completed: Atomic, } /// An atomic node pointer with relaxed operations. -struct AtomicLink(AtomicPtr); +struct AtomicLink(Atomic<*mut Node>); impl AtomicLink { fn new(v: Option>) -> AtomicLink { -- cgit 1.4.1-3-g733a5