Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » Thing » AtomicInt » AtomicInt &= ZZ
next | previous | forward | backward | up | index | toc

# AtomicInt &= ZZ -- atomic fetch and bitwise and

- Operator: &=
- Usage:
    `x &= y`
- Inputs:
  - x, an atomic integer,
  - y, an integer,
- Outputs:
  - an integer,

## Description

Bitwise and is performed between x and y and the original value of x is returned. This operation occurs atomically and is thread safe.

    i1 : x = new AtomicInt from 12

    o1 = 12

    o1 : AtomicInt

    i2 : x &= 10

    o2 = 12

    i3 : x

    o3 = 8

    o3 : AtomicInt

## Ways to use this method:

- AtomicInt &= ZZ -- atomic fetch and bitwise and

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/doc_atomic.m2:142:0.