AtomicDelegates

Factory object for creating thread-safe atomic property delegates.

Functions

Link copied to clipboard
fun atomicBoolean(initValue: Boolean = false): ReadWriteProperty<Any?, Boolean>

Creates a thread-safe Boolean property delegate backed by AtomicBoolean.

Link copied to clipboard
fun atomicInteger(initValue: Int = 0): ReadWriteProperty<Any?, Int>

Creates a thread-safe Int property delegate backed by AtomicInt.

Link copied to clipboard
fun atomicLong(initValue: Long = 0): ReadWriteProperty<Any?, Long>

Creates a thread-safe Long property delegate backed by AtomicLong.

Link copied to clipboard
fun <T : Any> nonNullableReference(initValue: T? = null): ReadWriteProperty<Any?, T>

Creates a thread-safe delegate for a non-nullable property backed by an AtomicReference.

Link copied to clipboard
fun <T> singleSetReference(initValue: T? = null, compareValue: T? = initValue): ReadWriteProperty<Any?, T?>

Creates a thread-safe delegate that can only be set once.