Move FullJdk tests to boxWithStdlib

This commit is contained in:
Alexander Udalov
2013-02-07 21:51:43 +04:00
committed by Alexander Udalov
parent d23f82177f
commit f994c9924f
8 changed files with 40 additions and 52 deletions
@@ -0,0 +1,21 @@
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"
}