# [−][src]Function core::arch::wasm32::i64_atomic_wait

    pub unsafe fn i64_atomic_wait(
        ptr: *mut i64,
        expression: i64,
        timeout_ns: i64
    ) -> i32

🔬 This is a nightly-only experimental API. (`stdsimd` #48556)
This is supported on WebAssembly only.

Corresponding intrinsic to wasm's `i64.atomic.wait` instruction

This function, when called, will block the current thread if the memory pointed to by `ptr` is equal to `expression` (performing this action atomically).

The argument `timeout_ns` is a maxinum number of nanoseconds the calling thread will be blocked for, if it blocks. If the timeout is negative then the calling thread will be blocked forever.

The calling thread can only be woken up with a call to the `wake` intrinsic once it has been blocked. Changing the memory behind `ptr` will not wake the thread once it's blocked.

# Return value

- 0 - indicates that the thread blocked and then was woken up
- 1 - the loaded value from `ptr` didn't match `expression`, the thread didn't block
- 2 - the thread blocked, but the timeout expired.

# Availability

This intrinsic is only available when the standard library itself is compiled with the `atomics` target feature. This version of the standard library is not obtainable via `rustup`, but rather will require the standard library to be compiled from source.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)