[jboss-cvs] JBossAS SVN: r60496 - branches/Branch_4_0/messaging/src/main/org/jboss/mq.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 12 11:33:43 EST 2007


Author: adrian at jboss.org
Date: 2007-02-12 11:33:43 -0500 (Mon, 12 Feb 2007)
New Revision: 60496

Modified:
   branches/Branch_4_0/messaging/src/main/org/jboss/mq/Connection.java
Log:
Port JBAS-4090 from head

Modified: branches/Branch_4_0/messaging/src/main/org/jboss/mq/Connection.java
===================================================================
--- branches/Branch_4_0/messaging/src/main/org/jboss/mq/Connection.java	2007-02-12 16:33:05 UTC (rev 60495)
+++ branches/Branch_4_0/messaging/src/main/org/jboss/mq/Connection.java	2007-02-12 16:33:43 UTC (rev 60496)
@@ -1282,14 +1282,20 @@
 	 */
    class PingTask implements Runnable
    {
-      /**
-		 * Main processing method for the PingTask object
-		 */
       public void run()
       {
+         // Don't bother if we are closing
+         if (closing.get())
+            return;
+         
          try
          {
-            pingTaskSemaphore.acquire();
+            // If we can't aquire the semaphore then it
+            // almost certainly means the close has got it
+            // Try for 10 seconds to make sure the problem
+            // is not just a long garbage collection that has suspended threads
+            if (pingTaskSemaphore.attempt(1000 * 10) == false)
+               return;
          }
          catch (InterruptedException e)
          {




More information about the jboss-cvs-commits mailing list