Deprecate monitorEnter and monitorExit not to be used from user code.

This commit is contained in:
Ilya Gorbunov
2015-11-18 04:29:45 +03:00
parent 9d24f1d1cf
commit 47b3859641
2 changed files with 3 additions and 0 deletions
@@ -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")
@@ -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 <R> synchronized(lock: Any, block: () -> R): R {
monitorEnter(lock)
try {