Files
kotlin-fork/compiler/testData/codegen/box/fullJdk/regressions/kt15112.kt
T
Dmitriy Novozhilov 770dfb69ba [FIR] Analyze all statements in block except last one in independent mode
Some broken tests will be fixed in next commit
#KT-37176 Fixed
2020-03-05 16:48:47 +03:00

30 lines
596 B
Kotlin
Vendored

// FULL_JDK
// WITH_RUNTIME
// TARGET_BACKEND: JVM
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"
}