Atomically compares a 32-bit value with the 32-bit value at the specified address, and if equal to the value specified for comparison, replaces that value with a new one.
#include <stdlib.h> unsigned long atomic_cmpxchg ( unsigned long *addr, unsigned long cmpvalue, unsigned long newvalue);
(IN) Points to the memory location for the operation.
(IN) Specifies the value to compare.
(IN) Specifies the replacement value if cmpvalue is the same as the value in the memory location.
Returns the original value in the memory location.
The memory location address is expected to be valid. If an invalid address is passed, the server will abend.