compare And Swap
external fun compareAndSwap(expected: NativePtr, new: NativePtr): NativePtr
Content copied to clipboard
Compares value with expected and replaces it with new value if values matches. If new value is not null, it must be frozen or permanent object.
Return
the old value
Parameters
expected
the expected value
new
the new value
Throws
if new is not frozen or a permanent object