[jboss-cvs] JBossAS SVN: r100434 - trunk/testsuite/src/main/org/jboss/test/jmx/shutdown.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 4 14:43:44 EST 2010


Author: david.lloyd at jboss.com
Date: 2010-02-04 14:43:44 -0500 (Thu, 04 Feb 2010)
New Revision: 100434

Modified:
   trunk/testsuite/src/main/org/jboss/test/jmx/shutdown/ExitOnShutdown.java
Log:
Simpler ExitOnShutdown service implementation which avoids the CL issue without using a relatively complex synchronization scheme

Modified: trunk/testsuite/src/main/org/jboss/test/jmx/shutdown/ExitOnShutdown.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jmx/shutdown/ExitOnShutdown.java	2010-02-04 19:42:39 UTC (rev 100433)
+++ trunk/testsuite/src/main/org/jboss/test/jmx/shutdown/ExitOnShutdown.java	2010-02-04 19:43:44 UTC (rev 100434)
@@ -25,8 +25,6 @@
 
 import org.jboss.system.ServiceMBeanSupport;
 
-import java.util.concurrent.CountDownLatch;
-
 /** A service that calls System.exit from its stopService method. Note that
  * this service cannot be deployed when the server is shutdown as its call
  * to System.exit(0) will hang the vm in java.lang.Shutdown.exit as the
@@ -47,22 +45,14 @@
 
    protected void stopService()
    {
-      final CountDownLatch latch = new CountDownLatch(1);
+      final Runtime r = Runtime.getRuntime();
       Thread thread = new Thread(new Runnable()
       {
          public void run()
          {
-            Runtime r = Runtime.getRuntime();
-            latch.countDown();
             r.exit(0);
          }
       }, "ExitOnShutdown");
       thread.start();
-      for (;;) try {
-         latch.await();
-         break;
-      } catch (InterruptedException e) {
-         // eat it
-      }
    }
 }




More information about the jboss-cvs-commits mailing list