[jboss-cvs] JBoss Messaging SVN: r8466 - in branches/JBPAPP-7460: src/main/org/jboss/messaging/core/impl/postoffice and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 1 06:50:04 EDT 2011


Author: raggz
Date: 2011-11-01 06:50:04 -0400 (Tue, 01 Nov 2011)
New Revision: 8466

Modified:
   branches/JBPAPP-7460/
   branches/JBPAPP-7460/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
Log:
Backport of JBMessaging-1896


Property changes on: branches/JBPAPP-7460
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/Branch_1_4:8114,8155-8158,8233-8234
/branches/JBM1842:8169-8232
   + /branches/Branch_1_4:8114,8155-8158,8233-8234,8447
/branches/JBM1842:8169-8232

Modified: branches/JBPAPP-7460/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/JBPAPP-7460/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2011-11-01 10:24:19 UTC (rev 8465)
+++ branches/JBPAPP-7460/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2011-11-01 10:50:04 UTC (rev 8466)
@@ -257,6 +257,7 @@
    private Object viewUpdateLock;
    private boolean stopUpdate = false;
    private boolean updateInProcess = false;
+   private Thread updateThread;
    
    private StateMonitor stateMonitor = null;
    
@@ -834,8 +835,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);
@@ -855,6 +860,7 @@
       {
          if (stopUpdate) return false;
          updateInProcess = true;
+         updateThread = Thread.currentThread();
       }
       return true;
    }
@@ -864,6 +870,7 @@
       synchronized (viewUpdateLock)
       {
          updateInProcess = false;
+         updateThread = null;
          viewUpdateLock.notify();
       }
    }



More information about the jboss-cvs-commits mailing list