< prev index next >

test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java

Print this page
rev 12487 : 8172149: CTW library should call System::exit
Reviewed-by:

@@ -57,10 +57,12 @@
         }
         if (os != null) {
             OUT = os;
         }
 
+        boolean passed = false;
+
         try {
             try {
                 if (ManagementFactory.getCompilationMXBean() == null) {
                     throw new RuntimeException(
                             "CTW can not work in interpreted mode");

@@ -82,14 +84,14 @@
             }
             CompileTheWorld.OUT.printf("Done (%d classes, %d methods, %d ms)%n",
                     PathHandler.getClassCount(),
                     Compiler.getMethodCount(),
                     System.currentTimeMillis() - start);
+            passed = true;
         } finally {
-            if (os != null) {
-                os.close();
-            }
+            // <clinit> might have started new threads
+            System.exit(passed ? 0 : 1);
         }
     }
 
     private static ExecutorService createExecutor() {
         final int threadsCount = Math.min(
< prev index next >