@@ -64,6 +64,7 @@ use crate::sync::atomic::{
64
64
} ;
65
65
use crate :: sys:: { c, dur2timeout} ;
66
66
use crate :: time:: Duration ;
67
+ use core:: ffi:: c_void;
67
68
68
69
pub struct Parker {
69
70
state : AtomicI8 ,
@@ -117,7 +118,7 @@ impl Parker {
117
118
118
119
loop {
119
120
// Wait for something to happen, assuming it's still set to PARKED.
120
- c:: WaitOnAddress ( self . ptr ( ) , & PARKED as * const _ as c :: LPVOID , 1 , c:: INFINITE ) ;
121
+ c:: WaitOnAddress ( self . ptr ( ) , & PARKED as * const _ as * const c_void , 1 , c:: INFINITE ) ;
121
122
// Change NOTIFIED=>EMPTY but leave PARKED alone.
122
123
if self . state . compare_exchange ( NOTIFIED , EMPTY , Acquire , Acquire ) . is_ok ( ) {
123
124
// Actually woken up by unpark().
@@ -144,7 +145,7 @@ impl Parker {
144
145
}
145
146
146
147
// Wait for something to happen, assuming it's still set to PARKED.
147
- c:: WaitOnAddress ( self . ptr ( ) , & PARKED as * const _ as c :: LPVOID , 1 , dur2timeout ( timeout) ) ;
148
+ c:: WaitOnAddress ( self . ptr ( ) , & PARKED as * const _ as * const c_void , 1 , dur2timeout ( timeout) ) ;
148
149
// Set the state back to EMPTY (from either PARKED or NOTIFIED).
149
150
// Note that we don't just write EMPTY, but use swap() to also
150
151
// include an acquire-ordered read to synchronize with unpark()'s
@@ -177,8 +178,8 @@ impl Parker {
177
178
}
178
179
}
179
180
180
- fn ptr ( & self ) -> c :: LPVOID {
181
- core:: ptr:: addr_of!( self . state) as c :: LPVOID
181
+ fn ptr ( & self ) -> * const c_void {
182
+ core:: ptr:: addr_of!( self . state) . cast :: < c_void > ( )
182
183
}
183
184
}
184
185
0 commit comments