activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r602260 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTopicSub.java
Date Fri, 07 Dec 2007 22:47:11 GMT
Author: rajdavies
Date: Fri Dec  7 14:47:10 2007
New Revision: 602260

URL: http://svn.apache.org/viewvc?rev=602260&view=rev
Log:
Added synchronization to prevent concurrent modification 

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTopicSub.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTopicSub.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTopicSub.java?rev=602260&r1=602259&r2=602260&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTopicSub.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTopicSub.java
Fri Dec  7 14:47:10 2007
@@ -38,7 +38,7 @@
         map.put(id, message);
     }
 
-    void removeMessage(MessageId id) {
+    synchronized void removeMessage(MessageId id) {
         map.remove(id);
         if (map.isEmpty()) {
             lastBatch = null;
@@ -49,7 +49,7 @@
         return map.size();
     }
 
-    void recoverSubscription(MessageRecoveryListener listener) throws Exception {
+    synchronized void recoverSubscription(MessageRecoveryListener listener) throws Exception
{
         for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
             Map.Entry entry = (Entry)iter.next();
             Object msg = entry.getValue();
@@ -61,7 +61,7 @@
         }
     }
 
-    void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
{
+    synchronized void recoverNextMessages(int maxReturned, MessageRecoveryListener listener)
throws Exception {
         boolean pastLackBatch = lastBatch == null;
         MessageId lastId = null;
         // the message table is a synchronizedMap - so just have to synchronize
@@ -88,7 +88,7 @@
 
     }
 
-    void resetBatching() {
+    synchronized void resetBatching() {
         lastBatch = null;
     }
 }



Mime
View raw message