c/atomic/atomic fetch add

Atomically replaces the value pointed by with the result of addition of  to the old value of, and returns the value  held previously. The operation is read-modify-write operation. The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to.

For signed integer types, arithmetic is defined to use two’s complement representation. There are no undefined results. For pointer types, the result may be an undefined address, but the operations otherwise have no undefined behavior.

Return value
The value held previously by the atomic object pointed to by.