Function js_sys::Atomics::wait_async
source · pub fn wait_async(
typed_array: &Int32Array,
index: u32,
value: i32
) -> Result<Object, JsValue>
Expand description
The static Atomics.waitAsync()
method verifies that a given position in an
Int32Array
still contains a given value and if so sleeps, awaiting a
wakeup or a timeout. It returns an object with two properties. The first
property async
is a boolean which if true indicates that the second
property value
is a promise. If async
is false then value is a string
whether equal to either “not-equal” or “timed-out”.
Note: This operation only works with a shared Int32Array
and may be used
on the main thread.
You should use wait_async_bigint
to operate on a BigInt64Array
.