compareAndSwap

external fun compareAndSwap(expected: NativePtr, new: NativePtr): NativePtr(source)

Compares value with expected and replaces it with new value if values matches.

Since Kotlin

1.3

Return

the old value

Parameters

expected

the expected value

new

the new value