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

Comparing jsr166/src/test/tck/ForkJoinTask8Test.java (file contents):
Revision 1.16 by jsr166, Wed Sep 9 00:26:59 2015 UTC vs.
Revision 1.17 by jsr166, Wed Sep 9 00:33:23 2015 UTC

# Line 1165 | Line 1165 | public class ForkJoinTask8Test extends J
1165          final ForkJoinTask b = ForkJoinTask.adapt(awaiter(done));
1166          final ForkJoinTask c = ForkJoinTask.adapt(awaiter(done));
1167          final ForkJoinPool p = singletonPool();
1168 <        Thread external = new Thread() {
1169 <                public void run() {
1170 <                    p.execute(a);
1171 <                    p.execute(b);
1172 <                    p.execute(c);
1173 <                }};
1168 >        Thread external = new Thread(new CheckedRunnable() {
1169 >            public void realRun() {
1170 >                p.execute(a);
1171 >                p.execute(b);
1172 >                p.execute(c);
1173 >            }});
1174          RecursiveAction s = new CheckedRecursiveAction() {
1175 <                protected void realCompute() {
1176 <                    external.start();
1177 <                    try {
1178 <                        external.join();
1179 <                    } catch (Exception ex) {
1180 <                        threadUnexpectedException(ex);
1181 <                    }
1182 <                    assertTrue(p.hasQueuedSubmissions());
1183 <                    assertTrue(Thread.currentThread() instanceof ForkJoinWorkerThread);
1184 <                    ForkJoinTask r = ForkJoinTask.pollSubmission();
1185 <                    assertTrue(r == a || r == b || r == c);
1186 <                    assertFalse(r.isDone());
1187 <                }};
1175 >            protected void realCompute() {
1176 >                external.start();
1177 >                try {
1178 >                    external.join();
1179 >                } catch (Exception ex) {
1180 >                    threadUnexpectedException(ex);
1181 >                }
1182 >                assertTrue(p.hasQueuedSubmissions());
1183 >                assertTrue(Thread.currentThread() instanceof ForkJoinWorkerThread);
1184 >                ForkJoinTask r = ForkJoinTask.pollSubmission();
1185 >                assertTrue(r == a || r == b || r == c);
1186 >                assertFalse(r.isDone());
1187 >            }};
1188          try {
1189              p.invoke(s);
1190          } finally {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines