WorkerBoundReference

class WorkerBoundReference<out T : Any>(value: T)(source)

A shared reference to a Kotlin object that doesn't freeze the referred object when it gets frozen itself.

After freezing can be safely passed between workers, but value can only be accessed on the worker WorkerBoundReference was created on, unless the referred object is frozen too.

Note: Garbage collector currently cannot free any reference cycles with frozen WorkerBoundReference in them. To resolve such cycles consider using AtomicReference<WorkerBoundReference?> which can be explicitly nulled out.

Since Kotlin

1.3

Constructors

Link copied to clipboard
constructor(value: T)

Properties

Link copied to clipboard
val value: T

The referenced value.

Since Kotlin 1.3
Link copied to clipboard

The referenced value or null if referred object is not frozen and current worker is different from the one created this.

Since Kotlin 1.3
Link copied to clipboard

Worker that value is bound to.

Since Kotlin 1.3