Deprecate lazy() that synchronizes on a given lock in non-JVM platforms

Because the overload has a meaningful implementation only in JVM.
In other platforms the specified lock object is ignored.
In K/N it throws UnsupportedOperationException.
This commit is contained in:
Abduqodiri Qurbonzoda
2023-05-29 16:49:23 +03:00
committed by Space Team
parent 9864402cf8
commit 7d9ea28604
7 changed files with 14 additions and 0 deletions
+2
View File
@@ -84,6 +84,8 @@ public inline fun error(message: kotlin.Any): kotlin.Nothing
public fun <T> lazy(initializer: () -> T): kotlin.Lazy<T>
@kotlin.Deprecated(message = "Synchronization on Any? object is not supported.", replaceWith = kotlin.ReplaceWith(expression = "lazy(initializer)", imports = {}))
@kotlin.DeprecatedSinceKotlin(warningSince = "1.9")
public fun <T> lazy(lock: kotlin.Any?, initializer: () -> T): kotlin.Lazy<T>
public fun <T> lazy(mode: kotlin.LazyThreadSafetyMode, initializer: () -> T): kotlin.Lazy<T>