Function hermit_abi::futex_wait
source ยท pub unsafe extern "C" fn futex_wait(
address: *mut u32,
expected: u32,
timeout: *const timespec,
flags: u32,
) -> i32
Expand description
If the value at address matches the expected value, park the current thread until it is either
woken up with futex_wake
(returns 0) or an optional timeout elapses (returns -ETIMEDOUT).
Setting timeout
to null means the function will only return if futex_wake
is called.
Otherwise, timeout
is interpreted as an absolute time measured with CLOCK_MONOTONIC
.
If FUTEX_RELATIVE_TIMEOUT
is set in flags
the timeout is understood to be relative
to the current time.
Returns -EINVAL if address
is null, the timeout is negative or flags
contains unknown values.