--- jsr166/src/test/tck/JSR166TestCase.java 2019/09/05 20:51:26 1.261 +++ jsr166/src/test/tck/JSR166TestCase.java 2019/09/07 15:03:44 1.265 @@ -284,7 +284,7 @@ public class JSR166TestCase extends Test static volatile TestCase currentTestCase; // static volatile int currentRun = 0; static { - Runnable checkForWedgedTest = new Runnable() { public void run() { + Runnable wedgedTestDetector = new Runnable() { public void run() { // Avoid spurious reports with enormous runsPerTest. // A single test case run should never take more than 1 second. // But let's cap it at the high end too ... @@ -310,7 +310,7 @@ public class JSR166TestCase extends Test } lastTestCase = currentTestCase; }}}; - Thread thread = new Thread(checkForWedgedTest, "checkForWedgedTest"); + Thread thread = new Thread(wedgedTestDetector, "WedgedTestDetector"); thread.setDaemon(true); thread.start(); } @@ -1106,13 +1106,13 @@ public class JSR166TestCase extends Test continue; if ("Reference Handler".equals(name) && (lockName = info.getLockName()) != null - && lockName.startsWith("java.lang.ref.Reference$Lock")) + && lockName.startsWith("java.lang.ref")) continue; - if ("Finalizer".equals(name) + if (("Finalizer".equals(name) || "Common-Cleaner".equals(name)) && (lockName = info.getLockName()) != null - && lockName.startsWith("java.lang.ref.ReferenceQueue$Lock")) + && lockName.startsWith("java.lang.ref")) continue; - if ("checkForWedgedTest".equals(name)) + if ("WedgedTestDetector".equals(name)) continue; System.err.print(info); } @@ -1410,19 +1410,6 @@ public class JSR166TestCase extends Test return NANOSECONDS.toMillis(System.nanoTime() - startNanoTime); } -// void assertTerminatesPromptly(long timeoutMillis, Runnable r) { -// long startTime = System.nanoTime(); -// try { -// r.run(); -// } catch (Throwable fail) { threadUnexpectedException(fail); } -// if (millisElapsedSince(startTime) > timeoutMillis/2) -// throw new AssertionError("did not return promptly"); -// } - -// void assertTerminatesPromptly(Runnable r) { -// assertTerminatesPromptly(LONG_DELAY_MS/2, r); -// } - /** * Checks that timed f.get() returns the expected value, and does not * wait for the timeout to elapse before returning. @@ -1470,7 +1457,7 @@ public class JSR166TestCase extends Test try { threadFail(detail); } finally { - // Interrupt thread __after__ having reported its stack trace + // Interrupt thread __after__ having reported its stack trace thread.interrupt(); } }