@@ -104,6 +104,8 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -
104104///
105105/// Returns true if this actually woke up such a thread,
106106/// or false if no thread was waiting on this futex.
107+ ///
108+ /// On some platforms, this always returns false.
107109#[ cfg( any( target_os = "linux" , target_os = "android" , target_os = "netbsd" ) ) ]
108110pub fn futex_wake ( futex : & AtomicU32 ) -> bool {
109111 let ptr = futex as * const AtomicU32 ;
@@ -135,9 +137,9 @@ pub fn futex_wake_all(futex: &AtomicU32) {
135137 }
136138}
137139
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 .
139141#[ cfg( target_os = "freebsd" ) ]
140- pub fn futex_wake ( futex : & AtomicU32 ) {
142+ pub fn futex_wake ( futex : & AtomicU32 ) -> bool {
141143 use crate :: ptr:: null_mut;
142144 unsafe {
143145 libc:: _umtx_op (
@@ -148,6 +150,7 @@ pub fn futex_wake(futex: &AtomicU32) {
148150 null_mut ( ) ,
149151 )
150152 } ;
153+ false
151154}
152155
153156#[ cfg( target_os = "freebsd" ) ]
@@ -231,10 +234,11 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -
231234 r == 0 || super :: os:: errno ( ) != libc:: ETIMEDOUT
232235}
233236
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 .
235238#[ cfg( target_os = "dragonfly" ) ]
236- pub fn futex_wake ( futex : & AtomicU32 ) {
239+ pub fn futex_wake ( futex : & AtomicU32 ) -> bool {
237240 unsafe { libc:: umtx_wakeup ( futex as * const AtomicU32 as * const i32 , 1 ) } ;
241+ false
238242}
239243
240244#[ cfg( target_os = "dragonfly" ) ]
0 commit comments