mirror of https://github.com/apache/activemq.git
Protect the messagesWaitingForSpace variable against concurrent modification.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@633210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e376456111
commit
3d18d59904
|
@ -885,9 +885,12 @@ public class Queue extends BaseDestination implements Task {
|
|||
log.error("Failed to page in more queue messages ", e);
|
||||
}
|
||||
}
|
||||
while (!messagesWaitingForSpace.isEmpty() && !memoryUsage.isFull()) {
|
||||
Runnable op = messagesWaitingForSpace.removeFirst();
|
||||
op.run();
|
||||
|
||||
synchronized(messagesWaitingForSpace) {
|
||||
while (!messagesWaitingForSpace.isEmpty() && !memoryUsage.isFull()) {
|
||||
Runnable op = messagesWaitingForSpace.removeFirst();
|
||||
op.run();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue