From 24fea9368c385b6850daa344006d7ba5a9da7313 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Thu, 7 Feb 2008 21:42:56 +0000 Subject: [PATCH] iterate() now returns false after every run to prevent spinning git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@619652 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/activemq/broker/region/Queue.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java index 62b9f2f78a..525faaa85f 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -895,11 +895,8 @@ public class Queue extends BaseDestination implements Task { Runnable op = messagesWaitingForSpace.removeFirst(); op.run(); } - - synchronized (messages) { - result = !messages.isEmpty(); - } - return result; + //must return false to prevent spinning + return false; } protected MessageReferenceFilter createMessageIdFilter(final String messageId) {