4 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
< |
import java.util.*; |
8 |
< |
import java.util.concurrent.*; |
9 |
< |
import java.util.concurrent.locks.*; |
7 |
> |
import java.util.Collections; |
8 |
> |
import java.util.concurrent.Callable; |
9 |
> |
import java.util.concurrent.ExecutorService; |
10 |
> |
import java.util.concurrent.Executors; |
11 |
> |
import java.util.concurrent.TimeUnit; |
12 |
> |
import java.util.concurrent.locks.ReentrantLock; |
13 |
|
|
14 |
|
/** |
15 |
|
* Measures repeated futile timed attempts to acquire a ReentrantLock. |
54 |
|
continue nextArg; |
55 |
|
} |
56 |
|
} |
57 |
< |
throw new Error("Usage: FutileTimedTryLockLoops minThreads=n maxThreads=n Threads=n nanos=n iters=n"); |
57 |
> |
throw new Error("Usage: FutileTimedTryLockLoops minThreads=n maxThreads=n threads=n nanos=n iters=n"); |
58 |
|
} |
59 |
|
final ExecutorService pool = Executors.newCachedThreadPool(); |
60 |
|
final ReentrantLock lock = new ReentrantLock(); |