langtools/test/tools/javac/lib/JavacTestingAbstractThreadedTest.java
changeset 15384 5a8d00abf076
parent 15040 99fd9483d3f0
child 15551 64c22739fdb8
--- a/langtools/test/tools/javac/lib/JavacTestingAbstractThreadedTest.java	Wed Jan 23 15:08:03 2013 +0000
+++ b/langtools/test/tools/javac/lib/JavacTestingAbstractThreadedTest.java	Wed Jan 23 20:57:40 2013 +0000
@@ -26,6 +26,7 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import javax.tools.JavaCompiler;
 import javax.tools.StandardJavaFileManager;
@@ -67,9 +68,7 @@
     protected static void checkAfterExec(boolean printCheckCount)
             throws InterruptedException {
         pool.shutdown();
-        while (!pool.isTerminated()) {
-            Thread.sleep(10);
-        }
+        pool.awaitTermination(15, TimeUnit.MINUTES);
         if (errCount.get() > 0) {
             if (throwAssertionOnError) {
                 closePrinters();