93561a1a55
* kotlinx.atomicfu compiler plugin for JS_IR Support transformations of atomic operations introduced by the kotlinx.atomicfu library for the JS_IR backend. Compiler plugin is applied externally by the kotlinx.atomicfu gradle plugin. * Apply compiler plugin for JS platform only * New plugin test structure * testGroupOutputDirPrefix changed
20 lines
375 B
Kotlin
Vendored
20 lines
375 B
Kotlin
Vendored
import kotlinx.atomicfu.locks.*
|
|
import kotlin.test.*
|
|
|
|
class ReentrantLockTest {
|
|
private val lock = reentrantLock()
|
|
private var state = 0
|
|
|
|
fun testLockField() {
|
|
lock.withLock {
|
|
state = 1
|
|
}
|
|
assertEquals(1, state)
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val testClass = ReentrantLockTest()
|
|
testClass.testLockField()
|
|
return "OK"
|
|
} |