Atomic.intExchangeAndAdd

Atomically adds val to the integer pointed to by atomic. It returns the value of *atomic just before the addition took place. Also acts as a memory barrier. Since 2.4

class Atomic
static
int
intExchangeAndAdd
(
int* atomic
,
int val
)

Parameters

atomic int*

a pointer to an integer

val int

the value to add to *atomic

Return Value

Type: int

the value of *atomic before the addition.

Meta