@@ -104,6 +104,8 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -
104
104
///
105
105
/// Returns true if this actually woke up such a thread,
106
106
/// or false if no thread was waiting on this futex.
107
+ ///
108
+ /// On some platforms, this always returns false.
107
109
#[ cfg( any( target_os = "linux" , target_os = "android" , target_os = "netbsd" ) ) ]
108
110
pub fn futex_wake ( futex : & AtomicU32 ) -> bool {
109
111
let ptr = futex as * const AtomicU32 ;
@@ -135,9 +137,9 @@ pub fn futex_wake_all(futex: &AtomicU32) {
135
137
}
136
138
}
137
139
138
- // FreeBSD doesn't tell us how many threads are woken up, so this doesn't return a bool .
140
+ // FreeBSD doesn't tell us how many threads are woken up, so this always returns false .
139
141
#[ cfg( target_os = "freebsd" ) ]
140
- pub fn futex_wake ( futex : & AtomicU32 ) {
142
+ pub fn futex_wake ( futex : & AtomicU32 ) -> bool {
141
143
use crate :: ptr:: null_mut;
142
144
unsafe {
143
145
libc:: _umtx_op (
@@ -148,6 +150,7 @@ pub fn futex_wake(futex: &AtomicU32) {
148
150
null_mut ( ) ,
149
151
)
150
152
} ;
153
+ false
151
154
}
152
155
153
156
#[ cfg( target_os = "freebsd" ) ]
@@ -231,10 +234,11 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -
231
234
r == 0 || super :: os:: errno ( ) != libc:: ETIMEDOUT
232
235
}
233
236
234
- // DragonflyBSD doesn't tell us how many threads are woken up, so this doesn't return a bool .
237
+ // DragonflyBSD doesn't tell us how many threads are woken up, so this always returns false .
235
238
#[ cfg( target_os = "dragonfly" ) ]
236
- pub fn futex_wake ( futex : & AtomicU32 ) {
239
+ pub fn futex_wake ( futex : & AtomicU32 ) -> bool {
237
240
unsafe { libc:: umtx_wakeup ( futex as * const AtomicU32 as * const i32 , 1 ) } ;
241
+ false
238
242
}
239
243
240
244
#[ cfg( target_os = "dragonfly" ) ]
0 commit comments