Package-level declarations

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
expect annotation class SharedImmutable

Marks a top level property with a backing field as immutable. It is possible to share the value of such property between multiple threads, but it becomes deeply frozen, so no changes can be made to its state or the state of objects it refers to.

Since Kotlin 1.0
Link copied to clipboard
expect annotation class ThreadLocal

Marks a top level property with a backing field or an object as thread local. The object remains mutable and it is possible to change its state, but every thread will have a distinct copy of this object, so changes in one thread are not reflected in another.

Since Kotlin 1.0