compareAndSet

expect fun compareAndSet(expected: V, new: V): Boolean(source)

Compare current value with expected and set to new if they're the same. Note, 'compare' is checking the actual object id, not 'equals'.

actual fun compareAndSet(expected: V, new: V): Boolean(source)

Compare current value with expected and set to new if they're the same. Note, 'compare' is checking the actual object id, not 'equals'.