getAndSet

fun getAndSet(newValue: T): T(source)

Deprecated (with error)

Use exchange(newValue: T) instead.

Replace with

this.exchange(newValue)

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

Since Kotlin

2.1