diff --git a/examples/src/benchmarks/LockPerf.kt b/examples/src/benchmarks/LockPerf.kt index c7a61eda5ed..064280780db 100644 --- a/examples/src/benchmarks/LockPerf.kt +++ b/examples/src/benchmarks/LockPerf.kt @@ -1,20 +1,11 @@ namespace lockperformance +import std.concurrent.* + import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.CountDownLatch; import java.util.concurrent.locks.ReentrantLock; -fun thread(f: fun ()) { - val thread = Thread( - object: Runnable { - override fun run() { - f() - } - } - ) - thread.start() -} - fun Int.latch(op: fun CountDownLatch.() : T) : T { val cdl = CountDownLatch(this) val res = cdl.op() @@ -22,7 +13,7 @@ fun Int.latch(op: fun CountDownLatch.() : T) : T { return res } -fun Int.times(action: fun Int.()) { +fun Int.times(action: fun():Unit) { for(i in 0..this-1) action() }