diff --git a/libraries/stdlib/src/kotlin/jvm/internal/unsafe/monitor.kt b/libraries/stdlib/src/kotlin/jvm/internal/unsafe/monitor.kt index 55b19030c38..32b5c2ea9f2 100644 --- a/libraries/stdlib/src/kotlin/jvm/internal/unsafe/monitor.kt +++ b/libraries/stdlib/src/kotlin/jvm/internal/unsafe/monitor.kt @@ -20,8 +20,10 @@ import kotlin.jvm.internal.Intrinsic /** @suppress */ @Intrinsic("kotlin.jvm.internal.unsafe.monitorEnter") +@Deprecated("This function supports the standard library infrastructure and is not intended to be used directly from user code.") public fun monitorEnter(monitor: Any): Unit = throw UnsupportedOperationException("This function can only be used privately") /** @suppress */ @Intrinsic("kotlin.jvm.internal.unsafe.monitorExit") +@Deprecated("This function supports the standard library infrastructure and is not intended to be used directly from user code.") public fun monitorExit(monitor: Any): Unit = throw UnsupportedOperationException("This function can only be used privately") diff --git a/libraries/stdlib/src/kotlin/util/Synchronized.kt b/libraries/stdlib/src/kotlin/util/Synchronized.kt index 4457dc11ddc..fbbca4192fe 100644 --- a/libraries/stdlib/src/kotlin/util/Synchronized.kt +++ b/libraries/stdlib/src/kotlin/util/Synchronized.kt @@ -8,6 +8,7 @@ import kotlin.jvm.internal.unsafe.* /** * Executes the given function [block] while holding the monitor of the given object [lock]. */ +@Suppress("DEPRECATION") public inline fun synchronized(lock: Any, block: () -> R): R { monitorEnter(lock) try {