Files
kotlin-fork/compiler/testData/codegen/box/fullJdk/regressions/kt15112.kt
T
2023-12-26 10:18:19 +00:00

31 lines
627 B
Kotlin
Vendored

// FULL_JDK
// WITH_STDLIB
// TARGET_BACKEND: JVM
// JVM_ABI_K1_K2_DIFF: KT-63864
import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlin.concurrent.read
import kotlin.concurrent.write
private val evalStateLock = ReentrantReadWriteLock()
private val classLoaderLock = ReentrantReadWriteLock()
val compiledClasses = arrayListOf("")
fun box(): String = evalStateLock.write {
classLoaderLock.read {
classLoaderLock.write {
"write"
}
compiledClasses.forEach {
it
}
}
classLoaderLock.read {
compiledClasses.map { it }
}
"OK"
}