diff options
| author | Stefan Lankes <slankes@eonerc.rwth-aachen.de> | 2023-02-26 23:21:19 +0100 |
|---|---|---|
| committer | Stefan Lankes <slankes@eonerc.rwth-aachen.de> | 2023-02-27 09:59:57 +0100 |
| commit | ae27762cebdcb441d85f05a906e6ae2e20c5ec47 (patch) | |
| tree | 646b9f52986b4de4ebec6a37a6a9c61dc572a77b /library/std | |
| parent | daf31a113cd24b85e1c8731b0531063477a1f92b (diff) | |
| download | rust-ae27762cebdcb441d85f05a906e6ae2e20c5ec47.tar.gz rust-ae27762cebdcb441d85f05a906e6ae2e20c5ec47.zip | |
use `as_ptr` to determine the address of atomics
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/sys/hermit/futex.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/hermit/futex.rs b/library/std/src/sys/hermit/futex.rs index b64c174b06c..427d8ff6f2e 100644 --- a/library/std/src/sys/hermit/futex.rs +++ b/library/std/src/sys/hermit/futex.rs @@ -16,7 +16,7 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) - let r = unsafe { abi::futex_wait( - futex.as_mut_ptr(), + futex.as_ptr(), expected, timespec.as_ref().map_or(null(), |t| t as *const abi::timespec), abi::FUTEX_RELATIVE_TIMEOUT, @@ -28,12 +28,12 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) - #[inline] pub fn futex_wake(futex: &AtomicU32) -> bool { - unsafe { abi::futex_wake(futex.as_mut_ptr(), 1) > 0 } + unsafe { abi::futex_wake(futex.as_ptr(), 1) > 0 } } #[inline] pub fn futex_wake_all(futex: &AtomicU32) { unsafe { - abi::futex_wake(futex.as_mut_ptr(), i32::MAX); + abi::futex_wake(futex.as_ptr(), i32::MAX); } } |
