diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2022-03-17 12:27:30 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2022-03-23 14:53:59 +0100 |
| commit | 73d63488e4a23de46a6312525ccb7b4d04a7c55f (patch) | |
| tree | 69c2869b3de3835cc02eece443d1b8f8b0e76e7a /library/std/src/sys | |
| parent | 4fbd71c94324965f5a3bcf01845b6da0d51076b7 (diff) | |
| download | rust-73d63488e4a23de46a6312525ccb7b4d04a7c55f.tar.gz rust-73d63488e4a23de46a6312525ccb7b4d04a7c55f.zip | |
Add futex_wake_all.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/unix/futex.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/futex.rs b/library/std/src/sys/unix/futex.rs index 22ba1a57fef..cc6da97ec73 100644 --- a/library/std/src/sys/unix/futex.rs +++ b/library/std/src/sys/unix/futex.rs @@ -66,6 +66,18 @@ pub fn futex_wake(futex: &AtomicI32) { } } +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn futex_wake_all(futex: &AtomicI32) { + unsafe { + libc::syscall( + libc::SYS_futex, + futex as *const AtomicI32, + libc::FUTEX_WAKE | libc::FUTEX_PRIVATE_FLAG, + i32::MAX, + ); + } +} + #[cfg(target_os = "emscripten")] pub fn futex_wake(futex: &AtomicI32) { extern "C" { |
