You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/01/23 23:50:16 UTC

svn commit: r499173 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java

Author: rajdavies
Date: Tue Jan 23 14:50:15 2007
New Revision: 499173

URL: http://svn.apache.org/viewvc?view=rev&rev=499173
Log:
add synchronize around pending
- see http://www.nabble.com/Is-anyone-else-seeing-messages-stuck-on-a-queue--tf3027911.html#a8550623

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java?view=diff&rev=499173&r1=499172&r2=499173
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java Tue Jan 23 14:50:15 2007
@@ -104,7 +104,7 @@
      * Occurs when a pull times out. If nothing has been dispatched since the timeout was setup, then send the NULL
      * message.
      */
-    private void pullTimeout(long dispatchCounterBeforePull){
+    private synchronized void pullTimeout(long dispatchCounterBeforePull){
         if(dispatchCounterBeforePull==dispatchCounter){
             try{
                 add(QueueMessageReference.NULL_MESSAGE);
@@ -368,7 +368,7 @@
         pending.remove(context,destination);
     }
 
-    protected void dispatchMatched() throws IOException{
+    protected synchronized void dispatchMatched() throws IOException{
         if(!broker.isSlaveBroker()&&dispatching.compareAndSet(false,true)){
             try{
                 try{