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

Comparing jsr166/src/test/tck/ForkJoinPool8Test.java (file contents):
Revision 1.15 by dl, Sun Sep 15 22:35:46 2013 UTC vs.
Revision 1.16 by jsr166, Mon Sep 16 00:48:00 2013 UTC

# Line 1494 | Line 1494 | public class ForkJoinPool8Test extends J
1494              final long startTime = System.nanoTime();
1495              assertTrue(p.isQuiescent());
1496              ForkJoinTask a = new CheckedRecursiveAction() {
1497 <                    protected void realCompute() {
1498 <                        FibAction f = new FibAction(8);
1499 <                        assertSame(f, f.fork());
1500 <                        boolean t = ForkJoinTask.getPool().awaitQuiescence(MEDIUM_DELAY_MS, TimeUnit.SECONDS);
1501 <                        assertTrue(t);
1502 <                        while (!f.isDone()) {
1503 <                            if (millisElapsedSince(startTime) > LONG_DELAY_MS)
1504 <                                threadFail("timed out");
1505 <                            assertFalse(p.getAsyncMode());
1506 <                            assertFalse(p.isShutdown());
1507 <                            assertFalse(p.isTerminating());
1508 <                            assertFalse(p.isTerminated());
1509 <                            Thread.yield();
1510 <                        }
1511 <                        assertFalse(p.isQuiescent());
1512 <                        assertEquals(0, ForkJoinTask.getQueuedTaskCount());
1513 <                        try {
1514 <                            assertEquals(21, f.result);
1515 <                        } catch (Throwable fail) {
1516 <                            threadFail(fail.getMessage());
1517 <                        }
1497 >                protected void realCompute() {
1498 >                    FibAction f = new FibAction(8);
1499 >                    assertSame(f, f.fork());
1500 >                    boolean t = ForkJoinTask.getPool().awaitQuiescence(MEDIUM_DELAY_MS, TimeUnit.SECONDS);
1501 >                    assertTrue(t);
1502 >                    while (!f.isDone()) {
1503 >                        if (millisElapsedSince(startTime) > LONG_DELAY_MS)
1504 >                            threadFail("timed out");
1505 >                        assertFalse(p.getAsyncMode());
1506 >                        assertFalse(p.isShutdown());
1507 >                        assertFalse(p.isTerminating());
1508 >                        assertFalse(p.isTerminated());
1509 >                        Thread.yield();
1510                      }
1511 <                };
1511 >                    assertFalse(p.isQuiescent());
1512 >                    assertEquals(0, ForkJoinTask.getQueuedTaskCount());
1513 >                    try {
1514 >                        assertEquals(21, f.result);
1515 >                    } catch (Throwable fail) {
1516 >                        threadFail(fail.getMessage());
1517 >                    }
1518 >                }};
1519              p.execute(a);
1520              while (!a.isDone() || !p.isQuiescent()) {
1521                  if (millisElapsedSince(startTime) > LONG_DELAY_MS)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines