[hornetq-commits] JBoss hornetq SVN: r9572 - trunk/src/main/org/hornetq/core/server/impl.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Aug 20 10:34:04 EDT 2010
Author: timfox
Date: 2010-08-20 10:34:03 -0400 (Fri, 20 Aug 2010)
New Revision: 9572
Modified:
trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
Log:
make sure inner delivery loop doesn't sping too long
Modified: trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-08-20 13:51:18 UTC (rev 9571)
+++ trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-08-20 14:34:03 UTC (rev 9572)
@@ -1070,6 +1070,15 @@
while (handled < numRefs)
{
+ if (handled == MAX_DELIVERIES_IN_LOOP)
+ {
+ // Schedule another one - we do this to prevent a single thread getting caught up in this loop for too long
+
+ deliverAsync();
+
+ return;
+ }
+
ConsumerHolder holder = consumerList.get(pos);
Consumer consumer = holder.consumer;
@@ -1160,14 +1169,7 @@
if (pos == size)
{
pos = 0;
- }
-
- if (handled == MAX_DELIVERIES_IN_LOOP)
- {
- // Schedule another one - we do this to prevent a single thread getting caught up in this loop for too long
-
- deliverAsync();
- }
+ }
}
}
More information about the hornetq-commits
mailing list