Skip to content

Commit 73d6348

Browse files
committed
Add futex_wake_all.
1 parent 4fbd71c commit 73d6348

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/std/src/sys/unix/futex.rs

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ pub fn futex_wake(futex: &AtomicI32) {
6666
}
6767
}
6868

69+
#[cfg(any(target_os = "linux", target_os = "android"))]
70+
pub fn futex_wake_all(futex: &AtomicI32) {
71+
unsafe {
72+
libc::syscall(
73+
libc::SYS_futex,
74+
futex as *const AtomicI32,
75+
libc::FUTEX_WAKE | libc::FUTEX_PRIVATE_FLAG,
76+
i32::MAX,
77+
);
78+
}
79+
}
80+
6981
#[cfg(target_os = "emscripten")]
7082
pub fn futex_wake(futex: &AtomicI32) {
7183
extern "C" {

0 commit comments

Comments
 (0)