[jboss-cvs] JBossAS SVN: r66324 - branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 22 05:36:59 EDT 2007


Author: bershath27
Date: 2007-10-22 05:36:59 -0400 (Mon, 22 Oct 2007)
New Revision: 66324

Modified:
   branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java
Log:
http://jira.jboss.com/jira/browse/ASPATCH-300


Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java	2007-10-22 05:15:43 UTC (rev 66323)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java	2007-10-22 09:36:59 UTC (rev 66324)
@@ -496,10 +496,19 @@
 
          while (true)
          {
+            synchronized (running)
+            {
+            if (writeState != STARTED)
+               break;
+            } 
+
             BaseMsg msg = null;
             try
             {
-               msg = (BaseMsg) sendQueue.take();
+               // Only wait for 10 seconds
+               msg = (BaseMsg) sendQueue.poll(10000l);
+               if (msg == null)
+                 continue; // re-start the loop when no message after 10 seconds 
                if (trace)
                   log.trace("Write msg: " + msg);
                msg.write(out);




More information about the jboss-cvs-commits mailing list