added synchronization around remove()

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@818955 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2009-09-25 18:59:02 +00:00
parent 9f6efd4b1f
commit 41b7acb0ba
1 changed files with 2 additions and 2 deletions

View File

@ -43,8 +43,8 @@ public class VMPendingMessageCursor extends AbstractPendingMessageCursor {
@Override
public List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception {
List<MessageReference> rc = new ArrayList<MessageReference>();
public synchronized List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception {
List<MessageReference> rc = new ArrayList<MessageReference>();
for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();) {
MessageReference r = iterator.next();
if( r.getRegionDestination()==destination ) {