Macaulay2 » Documentation
Packages » Macaulay2Doc :: AtomicInt += ZZ
next | previous | forward | backward | up | index | toc

AtomicInt += ZZ -- atomic fetch and add

Synopsis

Description

This performs a fetch-and-add operation. The atomic integer x is increased by y and its original value 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 = 22

o3 : AtomicInt

Ways to use this method: