From 22c4d30a89da478203203a9052ec3dfb333e7cb2 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 23 May 2020 22:28:46 +0300 Subject: [PATCH] Correct docs of ThreadLocal and SharedImmutable annotations - clarify that they have effect only in K/N - correct possible application targets of SharedImmutable KT-36245 --- .../stdlib/common/src/kotlin/NativeAnnotationsH.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/stdlib/common/src/kotlin/NativeAnnotationsH.kt b/libraries/stdlib/common/src/kotlin/NativeAnnotationsH.kt index 3fe50280218..c303b588c5d 100644 --- a/libraries/stdlib/common/src/kotlin/NativeAnnotationsH.kt +++ b/libraries/stdlib/common/src/kotlin/NativeAnnotationsH.kt @@ -6,11 +6,13 @@ package kotlin.native.concurrent /** - * Marks a top level variable with a backing field or an object as thread local. + * 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. * + * The annotation has effect only in Kotlin/Native platform. + * * PLEASE NOTE THAT THIS ANNOTATION MAY GO AWAY IN UPCOMING RELEASES. */ @Target(AnnotationTarget.PROPERTY, AnnotationTarget.CLASS) @@ -19,10 +21,12 @@ package kotlin.native.concurrent public expect annotation class ThreadLocal() /** - * Marks a top level variable with a backing field or an object as immutable. - * It is possible to share such object between multiple threads, but it becomes deeply frozen, + * 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. * + * The annotation has effect only in Kotlin/Native platform. + * * PLEASE NOTE THAT THIS ANNOTATION MAY GO AWAY IN UPCOMING RELEASES. */ @Target(AnnotationTarget.PROPERTY)