weakCompareAndSetVolatile

fun AtomicInt.weakCompareAndSetVolatile(expectedValue: Int, newValue: Int): Boolean

Possibly atomically sets the value to newValue if the current value == expectedValue.

Return

true if successful

Parameters

expectedValue

the expected value

newValue

the new value