org.mapdb / Atomic / Var / compareAndSet

compareAndSet

fun compareAndSet(expect: E, update: E): Boolean

Atomically sets the value to the given updated value if the current value equals the expected value.

Parameters

expect - the expected value

update - the new value

Return
true if successful. False return indicates that the actual value was not equal to the expected value.