getAndSet

fun getAndSet(newValue: Long): Long(source)

Deprecated (with error)

Use exchange(newValue: Long) instead.

Replace with

this.exchange(newValue)

Atomically sets the value to the given new value and returns the old value.

Since Kotlin

2.1