# atomicWait

`import { atomicWait } from "destack:sync";`

Wait on an atomic integer location.

Blocks the current Worker or parks the current simulated Worker while `ptr` equals `expected`.

```ds title="atomicWait"
export declare function atomicWait<T: Integer>(ptr: *T, expected: T, order: MemoryOrdering, timeoutNanos?: uint64 | undefined): "notEqual" | "timedOut" | "woken"
```

[language/library/src/sync/atomic.ds:506:511](https://github.com/destack-sh/destack/blob/main/language/library/src/sync/atomic.ds#L506-L511)
