Minor: Make internal monitorEnter/monitorExit functions private to remove them from the public API

#KT-11485
This commit is contained in:
Ilya Gorbunov
2016-03-30 17:41:07 +03:00
parent bbd6417d3c
commit 9caa17dc74
3 changed files with 4 additions and 11 deletions
@@ -16,8 +16,6 @@
package kotlin.jvm.internal.unsafe
@kotlin.internal.InlineExposed
internal fun monitorEnter(@Suppress("UNUSED_PARAMETER") monitor: Any): Unit = throw UnsupportedOperationException("This function can only be used privately")
private fun monitorEnter(@Suppress("UNUSED_PARAMETER") monitor: Any): Unit = throw UnsupportedOperationException("This function can only be used privately")
@kotlin.internal.InlineExposed
internal fun monitorExit(@Suppress("UNUSED_PARAMETER") monitor: Any): Unit = throw UnsupportedOperationException("This function can only be used privately")
private fun monitorExit(@Suppress("UNUSED_PARAMETER") monitor: Any): Unit = throw UnsupportedOperationException("This function can only be used privately")
@@ -10,13 +10,13 @@ import kotlin.jvm.internal.unsafe.*
*/
@kotlin.internal.InlineOnly
public inline fun <R> synchronized(lock: Any, block: () -> R): R {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE", "INVISIBLE_MEMBER")
monitorEnter(lock)
try {
return block()
}
finally {
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE", "INVISIBLE_MEMBER")
monitorExit(lock)
}
}