File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,21 @@ pub fn futex_wake_all(futex: &AtomicU32) {
202202 }
203203}
204204
205+ /// Wakes one waiter on `futex` and requeue the remaining waiters to `futex2`.
206+ #[ cfg( target_os = "openbsd" ) ]
207+ pub fn futex_requeue ( futex : & AtomicU32 , futex2 : & AtomicU32 ) {
208+ use crate :: ptr:: null;
209+ unsafe {
210+ libc:: futex (
211+ futex as * const AtomicU32 as * mut u32 ,
212+ libc:: FUTEX_REQUEUE ,
213+ 1 ,
214+ null :: < libc:: timespec > ( ) . with_addr ( i32:: MAX as usize ) ,
215+ futex2 as * const AtomicU32 as * mut u32 ,
216+ ) ;
217+ }
218+ }
219+
205220#[ cfg( target_os = "dragonfly" ) ]
206221pub fn futex_wait ( futex : & AtomicU32 , expected : u32 , timeout : Option < Duration > ) -> bool {
207222 // A timeout of 0 means infinite.
Original file line number Diff line number Diff line change 11cfg_if:: cfg_if! {
2- if #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ] {
2+ if #[ cfg( any( target_os = "linux" , target_os = "android" , target_os = "openbsd" ) ) ] {
33 mod futex_requeue;
44 pub use futex_requeue:: Condvar ;
55 } else if #[ cfg( any(
66 all( target_os = "windows" , not( target_vendor="win7" ) ) ,
77 target_os = "freebsd" ,
8- target_os = "openbsd" ,
98 target_os = "dragonfly" ,
109 target_os = "fuchsia" ,
1110 all( target_family = "wasm" , target_feature = "atomics" ) ,
You can’t perform that action at this time.
0 commit comments