Functions
Replaces the value at the given position in the array if the original value equals the given expected value, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.
Returns a value indicating whether high-performance algorithms can use atomic operations (true
) or must use locks (false
) for the given number of bytes-per-element of a typed array.
Wakes up sleeping agents that are waiting on the given index of the array, returning the number of agents that were awoken.
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"
.
A non-blocking, asynchronous version of wait which is usable on the main thread. Waits asynchronously on a shared memory location and returns a Promise