wait

fun wait(typedArray: Int32Array, index: Int, value: Int, timeout: Int = definedExternally): WaitStatus(source)
fun wait(typedArray: BigInt64Array, index: Int, value: BigInt, timeout: Int = definedExternally): WaitStatus(source)

If the value at the given position in the array is equal to the provided value, the current agent is put to sleep causing execution to suspend until the timeout expires (returning "timed-out") or until the agent is awoken (returning "ok"); otherwise, returns "not-equal".