[jboss-cvs] JBoss Messaging SVN: r8447 - branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 18 19:12:23 EDT 2011


Author: gaohoward
Date: 2011-10-18 19:12:22 -0400 (Tue, 18 Oct 2011)
New Revision: 8447

Modified:
   branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
Log:
https://issues.jboss.org/browse/JBMESSAGING-1896


Modified: branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2011-10-10 15:01:14 UTC (rev 8446)
+++ branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2011-10-18 23:12:22 UTC (rev 8447)
@@ -258,6 +258,7 @@
    private Object viewUpdateLock;
    private boolean stopUpdate = false;
    private boolean updateInProcess = false;
+   private Thread updateThread;
    
    private StateMonitor stateMonitor = null;
    
@@ -840,8 +841,12 @@
       {
          if (stopUpdate) return;
          stopUpdate = true;
-         while (updateInProcess)
+         if (trace)
          {
+            log.trace("updateThread is " + updateThread);
+         }
+         while (updateInProcess && (updateThread != Thread.currentThread()))
+         {
             try
             {
                log.info("Waiting for view update finish before stop post office " + this);
@@ -861,6 +866,7 @@
       {
          if (stopUpdate) return false;
          updateInProcess = true;
+         updateThread = Thread.currentThread();
       }
       return true;
    }
@@ -870,6 +876,7 @@
       synchronized (viewUpdateLock)
       {
          updateInProcess = false;
+         updateThread = null;
          viewUpdateLock.notify();
       }
    }



More information about the jboss-cvs-commits mailing list