# atomicFetchAnd

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

Atomic fetch-and-bitwise-and.

Atomically performs bitwise AND of `value` with the value at `ptr`.
Returns the previous value before the operation.

```ds title="atomicFetchAnd"
export declare function atomicFetchAnd<T: Integer>(ptr: *T, value: T, order: MemoryOrdering, scope: AtomicScope, memoryScope: MemoryScope, regions: MemoryRegionSet, isVolatile: boolean, isMakeAvailable: boolean, isMakeVisible: boolean): T
```

[language/library/src/sync/atomic.ds:322:332](https://github.com/destack-sh/destack/blob/main/language/library/src/sync/atomic.ds#L322-L332)
