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

Comparing jsr166/src/test/tck/ForkJoinPoolTest.java (file contents):
Revision 1.70 by jsr166, Tue Oct 13 21:18:28 2015 UTC vs.
Revision 1.71 by jsr166, Thu Sep 15 01:18:01 2016 UTC

# Line 24 | Line 24 | import java.util.concurrent.Future;
24   import java.util.concurrent.RecursiveTask;
25   import java.util.concurrent.RejectedExecutionException;
26   import java.util.concurrent.atomic.AtomicBoolean;
27 + import java.util.concurrent.atomic.AtomicInteger;
28   import java.util.concurrent.locks.ReentrantLock;
29  
30   import junit.framework.AssertionFailedError;
# Line 57 | Line 58 | public class ForkJoinPoolTest extends JS
58  
59      // Some classes to test extension and factory methods
60  
60    static class MyHandler implements Thread.UncaughtExceptionHandler {
61        volatile int catches = 0;
62        public void uncaughtException(Thread t, Throwable e) {
63            ++catches;
64        }
65    }
66
61      static class MyError extends Error {}
62  
63      // to test handlers
# Line 74 | Line 68 | public class ForkJoinPoolTest extends JS
68  
69      static class FailingThreadFactory
70              implements ForkJoinPool.ForkJoinWorkerThreadFactory {
71 <        volatile int calls = 0;
71 >        final AtomicInteger calls = new AtomicInteger(0);
72          public ForkJoinWorkerThread newThread(ForkJoinPool p) {
73 <            if (++calls > 1) return null;
73 >            if (calls.incrementAndGet() > 1) return null;
74              return new FailingFJWSubclass(p);
75          }
76      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines