diff --git a/libraries/stdlib/src/kotlin/util/Lazy.kt b/libraries/stdlib/src/kotlin/util/Lazy.kt index b199c2cb0c9..ce064baa137 100644 --- a/libraries/stdlib/src/kotlin/util/Lazy.kt +++ b/libraries/stdlib/src/kotlin/util/Lazy.kt @@ -81,7 +81,7 @@ public fun lazy(lock: Any?, initializer: () -> T): Lazy = SynchronizedLaz public inline operator fun Lazy.getValue(thisRef: Any?, property: KProperty<*>): T = value /** - * Specifies how a [Lazy] instance synchronizes access among multiple threads. + * Specifies how a [Lazy] instance synchronizes initialization among multiple threads. */ public enum class LazyThreadSafetyMode { @@ -92,14 +92,14 @@ public enum class LazyThreadSafetyMode { /** * Initializer function can be called several times on concurrent access to uninitialized [Lazy] instance value, - * but only first returned value will be used as the value of [Lazy] instance. + * but only the first returned value will be used as the value of [Lazy] instance. */ PUBLICATION, /** - * No locks are used to synchronize the access to the [Lazy] instance value; if the instance is accessed from multiple threads, its behavior is undefined. + * No locks are used to synchronize an access to the [Lazy] instance value; if the instance is accessed from multiple threads, its behavior is undefined. * - * This mode should be used only when high performance is crucial and the [Lazy] instance is guaranteed never to be initialized from more than one thread. + * This mode should not be used unless the [Lazy] instance is guaranteed never to be initialized from more than one thread. */ NONE, }