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

Comparing jsr166/src/test/loops/CancelledFutureLoops.java (file contents):
Revision 1.4 by jsr166, Tue Nov 3 01:04:02 2009 UTC vs.
Revision 1.8 by jsr166, Mon Aug 10 06:47:33 2015 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   /*
# Line 18 | Line 18
18   * redistribute this code in any way without acknowledgement.
19   */
20  
21 + import java.util.*;
22   import java.util.concurrent.*;
23   import java.util.concurrent.locks.*;
23 import java.util.*;
24  
25   public final class CancelledFutureLoops {
26      static final ExecutorService pool = Executors.newCachedThreadPool();
# Line 44 | Line 44 | public final class CancelledFutureLoops
44          pool.shutdown();
45      }
46  
47 <    static final class FutureLoop implements Callable {
47 >    static final class FutureLoop implements Callable<Object> {
48          private int v = rng.next();
49          private final ReentrantLock lock = new ReentrantLock();
50          private final LoopHelpers.BarrierTimer timer = new LoopHelpers.BarrierTimer();
# Line 56 | Line 56 | public final class CancelledFutureLoops
56          }
57  
58          final void test() throws Exception {
59 <            Future[] futures = new Future[nthreads];
59 >            Future<?>[] futures = new Future<?>[nthreads];
60              for (int i = 0; i < nthreads; ++i)
61                  futures[i] = pool.submit(this);
62  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines