Files
kotlin-fork/compiler/testData/codegen/box/intrinsics/monitorEnterMonitorExit.kt
T
2020-07-22 12:16:32 +03:00

17 lines
255 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_RUNTIME
import kotlin.jvm.internal.unsafe.*
@Suppress("INVISIBLE_MEMBER")
fun box(): String {
val lock = Any()
monitorEnter(lock)
try {
return "OK"
}
finally {
monitorExit(lock)
}
}