--- jsr166/src/test/tck/ForkJoinTask8Test.java 2015/10/04 18:40:57 1.18 +++ jsr166/src/test/tck/ForkJoinTask8Test.java 2015/10/08 23:02:21 1.22 @@ -126,17 +126,17 @@ public class ForkJoinTask8Test extends J { Thread.currentThread().interrupt(); - long t0 = System.nanoTime(); + long startTime = System.nanoTime(); assertSame(expected, a.join()); - assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS); + assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS); Thread.interrupted(); } { Thread.currentThread().interrupt(); - long t0 = System.nanoTime(); + long startTime = System.nanoTime(); a.quietlyJoin(); // should be no-op - assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS); + assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS); Thread.interrupted(); } @@ -172,9 +172,9 @@ public class ForkJoinTask8Test extends J Thread.interrupted(); { - long t0 = System.nanoTime(); + long startTime = System.nanoTime(); a.quietlyJoin(); // should be no-op - assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS); + assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS); } try { @@ -198,9 +198,9 @@ public class ForkJoinTask8Test extends J abstract static class BinaryAsyncAction extends ForkJoinTask { - private BinaryAsyncAction parent; + private volatile BinaryAsyncAction parent; - private BinaryAsyncAction sibling; + private volatile BinaryAsyncAction sibling; protected BinaryAsyncAction() { setForkJoinTaskTag(INITIAL_STATE); @@ -317,6 +317,7 @@ public class ForkJoinTask8Test extends J } catch (Throwable ex) { compareAndSetForkJoinTaskTag(INITIAL_STATE, EXCEPTION_STATE); + throw new Error(ex); } return false; } @@ -1163,7 +1164,7 @@ public class ForkJoinTask8Test extends J final ForkJoinTask b = ForkJoinTask.adapt(awaiter(done)); final ForkJoinTask c = ForkJoinTask.adapt(awaiter(done)); final ForkJoinPool p = singletonPool(); - try (PoolCleaner cleaner = cleaner(p)) { + try (PoolCleaner cleaner = cleaner(p, done)) { Thread external = new Thread(new CheckedRunnable() { public void realRun() { p.execute(a); @@ -1185,7 +1186,6 @@ public class ForkJoinTask8Test extends J assertFalse(r.isDone()); }}; p.invoke(s); - done.countDown(); } }