WorkerBoundReference

Platform and version requirements: Native (1.3)
class WorkerBoundReference<out T : Any>

A frozen shared reference to a Kotlin object.

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 WorkerBoundReference in them. To resolve such cycles consider using AtomicReferenceWorkerBoundReference? which can be explicitly nulled out.

Constructors

Platform and version requirements: Native (1.3)

<init>

A frozen shared reference to a Kotlin object.

WorkerBoundReference(value: T)

Properties

Platform and version requirements: Native (1.3)

value

The referenced value.

val value: T
Platform and version requirements: Native (1.3)

valueOrNull

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

val valueOrNull: T?
Platform and version requirements: Native (1.3)

worker

Worker that value is bound to.

val worker: Worker

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-worker-bound-reference/index.html