wait

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "the timeout is clamped to 0 — wasm is single-threaded, so wait() is a non-blocking poll (a FLUSH has already executed every command).")
fun wait(mode: Fence.Mode = Mode.FLUSH, timeout: Long = FENCE_WAIT_FOR_EVER): Fence.FenceStatus

Client-side wait on the Fence.

Blocks the current thread until the Fence signals.

Return

FenceStatus.CONDITION_SATISFIED on success, FenceStatus.TIMEOUT_EXPIRED if the time out expired, or FenceStatus.ERROR in other cases.

Parameters

mode

Whether the command stream is flushed before waiting or not.

timeout

Wait time out in nanoseconds. Using a timeout of 0 is a way to query the state of the fence. FENCE_WAIT_FOR_EVER disables the timeout.