arch:: wasm32:: memory_atomic_wait32
pub unsafe fn memory_atomic_wait32(
ptr: *mut i32,
) -> i32
Corresponding intrinsic to wasm's
This function, when called, will block the current thread if the memory
pointed to by
ptr is equal to
expression (performing this action
timeout_ns is a maxinum number of nanoseconds the calling
thread will be blocked for, if it blocks. If the timeout is negative then
the calling thread will be blocked forever.
The calling thread can only be woken up with a call to the
once it has been blocked. Changing the memory behind
ptr will not wake
the thread once it's blocked.
- 0 - indicates that the thread blocked and then was woken up
- 1 - the loaded value from
expression, the thread didn't block
- 2 - the thread blocked, but the timeout expired.
This intrinsic is only available when the standard library itself is
compiled with the
atomics target feature. This version of the standard
library is not obtainable via
rustup, but rather will require the
standard library to be compiled from source.