activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r499173 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
Date Tue, 23 Jan 2007 22:50:16 GMT
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{



Mime
View raw message