Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
This commit is contained in:
committed by
Alexander Udalov
parent
54a615fcd3
commit
20e36438e2
@@ -0,0 +1,23 @@
|
||||
// FULL_JDK
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
fun <T> Int.latch(op: CountDownLatch.() -> T) : T {
|
||||
val cdl = CountDownLatch(this)
|
||||
val res = cdl.op()
|
||||
cdl.await()
|
||||
return res
|
||||
}
|
||||
|
||||
fun id(op : ()->Unit) = op()
|
||||
|
||||
fun box() : String {
|
||||
1.latch{
|
||||
id {
|
||||
countDown()
|
||||
}
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user