File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
library/std/src/sys/pal/unix Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
#![ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
2
2
3
- use crate :: io;
4
- use crate :: ptr:: null;
5
3
use crate :: sync:: atomic:: AtomicU32 ;
6
4
use crate :: sys:: cvt;
5
+ use crate :: { io, ptr} ;
7
6
8
7
pub const fn unlocked ( ) -> u32 {
9
8
0
@@ -26,10 +25,10 @@ pub fn futex_lock(futex: &AtomicU32) -> io::Result<()> {
26
25
match cvt ( unsafe {
27
26
libc:: syscall (
28
27
libc:: SYS_futex ,
29
- futex as * const AtomicU32 ,
28
+ ptr :: from_ref ( futex) ,
30
29
libc:: FUTEX_LOCK_PI | libc:: FUTEX_PRIVATE_FLAG ,
31
30
0 ,
32
- null :: < u32 > ( ) ,
31
+ ptr :: null :: < u32 > ( ) ,
33
32
// remaining args are unused
34
33
)
35
34
} ) {
@@ -44,7 +43,7 @@ pub fn futex_unlock(futex: &AtomicU32) -> io::Result<()> {
44
43
cvt ( unsafe {
45
44
libc:: syscall (
46
45
libc:: SYS_futex ,
47
- futex as * const AtomicU32 ,
46
+ ptr :: from_ref ( futex) ,
48
47
libc:: FUTEX_UNLOCK_PI | libc:: FUTEX_PRIVATE_FLAG ,
49
48
// remaining args are unused
50
49
)
You can’t perform that action at this time.
0 commit comments