Atomically replaces the current value with the result of computation involving the previous value and val. The operation is read-modify-write operation.
operator += performs atomic addition. Equivalent to return fetchAdd(arg) + arg;. operator -= performs atomic subtraction. Equivalent to return fetchSub(arg) - arg;. operator &= performs atomic bitwise and. Equivalent to return fetchAnd(arg) & arg;. operator |= performs atomic bitwise or. Equivalent to return fetchOr(arg) | arg;. operator ^= performs atomic bitwise exclusive or. Equivalent to return fetchXor(arg) ^ arg;.
value to perform the operation with
The atomic value AFTER the operation
See Implementation
Atomically replaces the current value with the result of computation involving the previous value and val. The operation is read-modify-write operation.
operator += performs atomic addition. Equivalent to return fetchAdd(arg) + arg;. operator -= performs atomic subtraction. Equivalent to return fetchSub(arg) - arg;. operator &= performs atomic bitwise and. Equivalent to return fetchAnd(arg) & arg;. operator |= performs atomic bitwise or. Equivalent to return fetchOr(arg) | arg;. operator ^= performs atomic bitwise exclusive or. Equivalent to return fetchXor(arg) ^ arg;.