Remove deprecated Common synchronized and deprecate it in JS #KT-46101
This commit is contained in:
@@ -155,6 +155,8 @@ public inline fun <R> runCatching(block: () -> R): kotlin.Result<R>
|
||||
@kotlin.SinceKotlin(version = "1.2")
|
||||
public inline fun <R> suspend(noinline block: suspend () -> R): suspend () -> R
|
||||
|
||||
@kotlin.DeprecatedSinceKotlin(warningSince = "1.6")
|
||||
@kotlin.Deprecated(message = "Synchronization on any object is not supported in Kotlin/JS", replaceWith = kotlin.ReplaceWith(expression = "run(block)", imports = {}))
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <R> synchronized(lock: kotlin.Any, block: () -> R): R
|
||||
|
||||
|
||||
@@ -118,6 +118,8 @@ public inline fun <R> runCatching(block: () -> R): kotlin.Result<R>
|
||||
@kotlin.SinceKotlin(version = "1.2")
|
||||
public inline fun <R> suspend(noinline block: suspend () -> R): suspend () -> R
|
||||
|
||||
@kotlin.DeprecatedSinceKotlin(warningSince = "1.6")
|
||||
@kotlin.Deprecated(message = "Synchronization on any object is not supported in Kotlin/JS", replaceWith = kotlin.ReplaceWith(expression = "run(block)", imports = {}))
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <R> synchronized(lock: kotlin.Any, block: () -> R): R
|
||||
|
||||
|
||||
@@ -58,15 +58,6 @@ public expect fun Float.toRawBits(): Int
|
||||
public expect fun Float.Companion.fromBits(bits: Int): Float
|
||||
|
||||
|
||||
// From concurrent.kt
|
||||
|
||||
@Deprecated("Synchronization on any object is not supported on every platform and will be removed from the common standard library soon.", level = DeprecationLevel.ERROR)
|
||||
@Suppress("NO_ACTUAL_FOR_EXPECT")
|
||||
public expect inline fun <R> synchronized(lock: Any, block: () -> R): R
|
||||
|
||||
|
||||
|
||||
|
||||
// from lazy.kt
|
||||
|
||||
public expect fun <T> lazy(initializer: () -> T): Lazy<T>
|
||||
|
||||
@@ -8,8 +8,11 @@ package kotlin
|
||||
import kotlin.contracts.*
|
||||
|
||||
|
||||
@DeprecatedSinceKotlin(warningSince = "1.6")
|
||||
@Deprecated("Synchronization on any object is not supported in Kotlin/JS", ReplaceWith("run(block)"))
|
||||
@kotlin.internal.InlineOnly
|
||||
public actual inline fun <R> synchronized(lock: Any, block: () -> R): R {
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
public inline fun <R> synchronized(lock: Any, block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import kotlin.jvm.internal.unsafe.*
|
||||
* Executes the given function [block] while holding the monitor of the given object [lock].
|
||||
*/
|
||||
@kotlin.internal.InlineOnly
|
||||
public actual inline fun <R> synchronized(lock: Any, block: () -> R): R {
|
||||
public inline fun <R> synchronized(lock: Any, block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
|
||||
@@ -87,9 +87,6 @@ public actual fun Float.Companion.fromBits(bits: Int): Float = wasm_f32_reinterp
|
||||
//@Deprecated("Use Volatile annotation from kotlin.jvm package", ReplaceWith("kotlin.jvm.Volatile"), level = DeprecationLevel.WARNING)
|
||||
//public typealias Volatile = kotlin.jvm.Volatile
|
||||
|
||||
@Deprecated("Synchronization on any object is not supported on every platform and will be removed from the common standard library soon.")
|
||||
public actual inline fun <R> synchronized(lock: Any, block: () -> R): R = TODO("Wasm stdlib: Kotlin")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user