Compares @atomic to @oldval and, if equal, sets it to @newval. If @atomic was not equal to @oldval then no change occurs.
This compare and exchange is done atomically.
Think of this operation as an atomic version of { if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }.
This call acts as a full compiler and hardware memory barrier.
a pointer to a #gint or #guint
the value to compare with
the value to conditionally replace with
%TRUE if the exchange took place
2.4
See Implementation
Compares @atomic to @oldval and, if equal, sets it to @newval. If @atomic was not equal to @oldval then no change occurs.
This compare and exchange is done atomically.
Think of this operation as an atomic version of { if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }.
This call acts as a full compiler and hardware memory barrier.