mirror of https://github.com/apache/activemq.git
synchronize around the messagesWaitingForSpace
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@633808 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f6fd249d8c
commit
e7316df001
|
@ -505,9 +505,11 @@ public class Topic extends BaseDestination implements Task{
|
|||
}
|
||||
|
||||
public boolean iterate() {
|
||||
while (!memoryUsage.isFull() && !messagesWaitingForSpace.isEmpty()) {
|
||||
Runnable op = messagesWaitingForSpace.removeFirst();
|
||||
op.run();
|
||||
synchronized(messagesWaitingForSpace) {
|
||||
while (!memoryUsage.isFull() && !messagesWaitingForSpace.isEmpty()) {
|
||||
Runnable op = messagesWaitingForSpace.removeFirst();
|
||||
op.run();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue