Type _ sync_fetch_and_add (type * PTR, type value ,...)
Type _ sync_fetch_and_sub (type * PTR, type value ,...)
Type _ sync_fetch_and_or (type * PTR, type value ,...)
Type _ sync_fetch_and_and (type * PTR, type value ,...)
Type _ sync_fetch_and_xor (type * PTR, type value ,...)
Type _ sync_fetch_and_nand (type * PTR, type value ,...)
These functions perform operations on the memory address pointed to by PTR and return the value before the operation.
Type _ sync_add_and_fetch (type * PTR, type value ,...)
Type _ sync_sub_and_fetch (type * PTR, type value ,...)
Type _ sync_or_and_fetch (type * PTR, type value ,...)
Type _ sync_and_and_fetch (type * PTR, type value ,...)
Type _ sync_xor_and_fetch (type * PTR, type value ,...)
Type _ sync_nand_and_fetch (type * PTR, type value ,...)
These functions perform operations on the memory address pointed to by PTR and return the value after the operation.
Bool _ sync_bool_compare_and_swap (type * PTR, type oldval, type newval ,...)
Type _ sync_val_compare_and_swap (type * PTR, type oldval, type newval ,...)
These two functions perform atomic comparison and exchange of variables. That is, if the value of the memory address pointed to by PTR is the same as that of oldval,
Replace it with the value of newval.
Return the comparison result of a function of the bool type, which is the same as true, and the difference is false. The function of the return type returns the value stored before the PTR pointing to the address exchange.
Type can be 1, 2, 4, or 8-byte int type, that is:
Int8_t/uint8_t
Int16_t/uint16_t
Int32_t/uint32_t
Int64_t/uint64_t