Compares the user data for the key key on object with
oldval, and if they are the same, replaces oldval with
newval.
This is like a typical atomic compare-and-exchange
operation, for user data on an object.
If the previous value was replaced then ownership of the
old value (oldval) is passed to the caller, including
the registered destroy notify for it (passed out in old_destroy).
Its up to the caller to free this as he wishes, which may
or may not include using old_destroy as sometimes replacement
should not destroy the object in the normal way.
Return: TRUE if the existing value for key was replaced
by newval, FALSE otherwise.
Since 2.34
Compares the user data for the key key on object with oldval, and if they are the same, replaces oldval with newval. This is like a typical atomic compare-and-exchange operation, for user data on an object. If the previous value was replaced then ownership of the old value (oldval) is passed to the caller, including the registered destroy notify for it (passed out in old_destroy). Its up to the caller to free this as he wishes, which may or may not include using old_destroy as sometimes replacement should not destroy the object in the normal way. Return: TRUE if the existing value for key was replaced by newval, FALSE otherwise. Since 2.34