Function futex2_wait [src]
Wait on a single futex.
Identical to the futex v1 FUTEX.FUTEX_WAIT_BITSET op, except it is part of the
futex2 family of calls.
Requires at least kernel v6.7.
Prototype
pub fn futex2_wait( uaddr: *const anyopaque, val: usize, mask: usize, flags: FUTEX2_FLAGS, timeout: ?*const kernel_timespec, clockid: clockid_t, ) usize
Parameters
uaddr: *const anyopaqueAddress of the futex to wait on.
val: usizeValue of uaddr.
mask: usizeBitmask to match against incoming wakeup masks. Must not be zero.
flags: FUTEX2_FLAGS
timeout: ?*const kernel_timespecOptional absolute timeout. Always 64-bit, even on 32-bit platforms.
clockid: clockid_tClock to be used for the timeout, realtime or monotonic.
Source
pub fn futex2_wait(
/// Address of the futex to wait on.
uaddr: *const anyopaque,
/// Value of `uaddr`.
val: usize,
/// Bitmask to match against incoming wakeup masks. Must not be zero.
mask: usize,
flags: FUTEX2_FLAGS,
/// Optional absolute timeout. Always 64-bit, even on 32-bit platforms.
timeout: ?*const kernel_timespec,
/// Clock to be used for the timeout, realtime or monotonic.
clockid: clockid_t,
) usize {
return syscall6(
.futex_wait,
@intFromPtr(uaddr),
val,
mask,
@as(u32, @bitCast(flags)),
@intFromPtr(timeout),
@intFromEnum(clockid),
);
}