diff options
| author | Christopher Durham <cad97@cad97.com> | 2024-09-19 00:15:03 -0400 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-04-27 02:18:08 +0300 |
| commit | 4d93f6056824c338751f19356d33bb61ce818749 (patch) | |
| tree | 44c5e3f9da28279a1e391f19ea6367677bf0adfa /library/std/src/sys/sync/thread_parking/pthread.rs | |
| parent | 96b4ed90c658acf7f180bf1b95192b4f08802059 (diff) | |
| download | rust-4d93f6056824c338751f19356d33bb61ce818749.tar.gz rust-4d93f6056824c338751f19356d33bb61ce818749.zip | |
use generic Atomic type where possible
in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
Diffstat (limited to 'library/std/src/sys/sync/thread_parking/pthread.rs')
| -rw-r--r-- | library/std/src/sys/sync/thread_parking/pthread.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/sync/thread_parking/pthread.rs b/library/std/src/sys/sync/thread_parking/pthread.rs index 19cabd7dd75..14bc793c15d 100644 --- a/library/std/src/sys/sync/thread_parking/pthread.rs +++ b/library/std/src/sys/sync/thread_parking/pthread.rs @@ -1,8 +1,8 @@ //! Thread parking without `futex` using the `pthread` synchronization primitives. use crate::pin::Pin; -use crate::sync::atomic::AtomicUsize; use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release}; +use crate::sync::atomic::{Atomic, AtomicUsize}; use crate::sys::pal::sync::{Condvar, Mutex}; use crate::time::Duration; @@ -11,7 +11,7 @@ const PARKED: usize = 1; const NOTIFIED: usize = 2; pub struct Parker { - state: AtomicUsize, + state: Atomic<usize>, lock: Mutex, cvar: Condvar, } |
