[hornetq-commits] JBoss hornetq SVN: r11892 - trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 9 05:41:08 EST 2011


Author: ataylor
Date: 2011-12-09 05:41:07 -0500 (Fri, 09 Dec 2011)
New Revision: 11892

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
added some syncronization on closerunnable

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2011-12-09 01:37:20 UTC (rev 11891)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java	2011-12-09 10:41:07 UTC (rev 11892)
@@ -21,6 +21,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Collections;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledExecutorService;
@@ -154,7 +155,7 @@
 
    private final Object waitLock = new Object();
 
-   public final static List<CloseRunnable> CLOSE_RUNNABLES = new ArrayList<CloseRunnable>();
+   public final static List<CloseRunnable> CLOSE_RUNNABLES =  Collections.synchronizedList(new ArrayList<CloseRunnable>());
 
    // Static
    // ---------------------------------------------------------------------------------------
@@ -1506,10 +1507,13 @@
 
    }
 
+   private static int size = 0;
    public class CloseRunnable implements Runnable
    {
       private final CoreRemotingConnection conn;
-
+      private int i = 0;
+      private boolean  removed = false;
+      private boolean  actuallRemoved = false;
       private CloseRunnable(CoreRemotingConnection conn)
       {
          this.conn = conn;
@@ -1533,8 +1537,8 @@
 
       public ClientSessionFactoryImpl stop()
       {
+         causeExit();
          CLOSE_RUNNABLES.remove(this);
-         causeExit();
          return ClientSessionFactoryImpl.this;
       }
 



More information about the hornetq-commits mailing list