MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / atomic_wait32

Method atomic_wait32

crates/wasmtime/src/runtime/memory.rs:1034–1041  ·  view source on GitHub ↗

Equivalent of the WebAssembly `memory.atomic.wait32` instruction for this shared memory. This method allows embedders to block the current thread until notified via the `memory.atomic.notify` instruction or the [`SharedMemory::atomic_notify`] method, enabling synchronization with the wasm guest as desired. The `expected` argument is the expected 32-bit value to be stored at the byte address `add

(
        &self,
        addr: u64,
        expected: u32,
        timeout: Option<Duration>,
    )

Source from the content-addressed store, hash-verified

1032 /// This function will return an error if `addr` is not within bounds or
1033 /// not aligned to a 4-byte boundary.
1034 pub fn atomic_wait32(
1035 &self,
1036 addr: u64,
1037 expected: u32,
1038 timeout: Option<Duration>,
1039 ) -> Result<WaitResult, Trap> {
1040 self.vm.atomic_wait32(addr, expected, timeout)
1041 }
1042
1043 /// Equivalent of the WebAssembly `memory.atomic.wait64` instruction for
1044 /// this shared memory.

Callers 2

Calls

no outgoing calls

Tested by 1