ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/FutileTimedTryLockLoops.java
(Generate patch)

Comparing jsr166/src/test/loops/FutileTimedTryLockLoops.java (file contents):
Revision 1.2 by jsr166, Wed Dec 31 17:00:58 2014 UTC vs.
Revision 1.4 by jsr166, Mon Jan 26 17:40:39 2015 UTC

# Line 51 | Line 51 | public final class FutileTimedTryLockLoo
51                      continue nextArg;
52                  }
53              }
54 <            throw new Error("Usage: FutileTimedTryLockLoops minThreads=n maxThreads=n Threads=n nanos=n iters=n");
54 >            throw new Error("Usage: FutileTimedTryLockLoops minThreads=n maxThreads=n threads=n nanos=n iters=n");
55          }
56          final ExecutorService pool = Executors.newCachedThreadPool();
57          final ReentrantLock lock = new ReentrantLock();
# Line 59 | Line 59 | public final class FutileTimedTryLockLoo
59          lock.lock();
60  
61          for (int i = minThreads; i <= maxThreads; i += (i+1) >>> 1) {
62 +            // warmup
63 +            if (i == minThreads)
64 +                pool.invokeAll(Collections.nCopies(i, task));
65 +
66              long startTime = System.nanoTime();
67              pool.invokeAll(Collections.nCopies(i, task));
68              long elapsed = System.nanoTime() - startTime;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines