mirror of https://github.com/apache/activemq.git
removed a couple of possible concurrent accesses of the message collection
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@390041 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
268a81b278
commit
2ed21cedd0
|
@ -98,7 +98,9 @@ public class Queue implements Destination {
|
|||
public void recoverMessage(Message message) {
|
||||
message.setRegionDestination(Queue.this);
|
||||
MessageReference reference = createMessageReference(message);
|
||||
messages.add(reference);
|
||||
synchronized (messages) {
|
||||
messages.add(reference);
|
||||
}
|
||||
reference.decrementReferenceCount();
|
||||
destinationStatistics.getMessages().increment();
|
||||
}
|
||||
|
@ -326,8 +328,12 @@ public class Queue implements Destination {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
int size = 0;
|
||||
synchronized (messages) {
|
||||
size = message.size();
|
||||
}
|
||||
return "Queue: destination=" + destination.getPhysicalName() + ", subscriptions=" + consumers.size()
|
||||
+ ", memory=" + usageManager.getPercentUsage() + "%, size=" + messages.size() + ", in flight groups="
|
||||
+ ", memory=" + usageManager.getPercentUsage() + "%, size=" + size + ", in flight groups="
|
||||
+ messageGroupOwners;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue