activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r887448 - in /activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src: main/java/org/apache/activemq/dispatch/internal/SerialDispatchQueue.java test/java/org/apache/activemq/actor/ActorTest.java
Date Fri, 04 Dec 2009 23:25:30 GMT
Author: chirino
Date: Fri Dec  4 23:25:30 2009
New Revision: 887448

URL: http://svn.apache.org/viewvc?rev=887448&view=rev
Log:
Redispatch the serial queue once resumed

Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/SerialDispatchQueue.java
    activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/test/java/org/apache/activemq/actor/ActorTest.java

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/SerialDispatchQueue.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/SerialDispatchQueue.java?rev=887448&r1=887447&r2=887448&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/SerialDispatchQueue.java
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/main/java/org/apache/activemq/dispatch/internal/SerialDispatchQueue.java
Fri Dec  4 23:25:30 2009
@@ -46,7 +46,11 @@
     }
 
     public void resume() {
-        suspendCounter.decrementAndGet();
+        if( suspendCounter.decrementAndGet() == 0 ) {
+            if( size.get() != 0 ) {
+                targetQueue.dispatchAsync(this);
+            }
+        }
     }
 
     public void suspend() {
@@ -66,7 +70,7 @@
             retain();
         }
         runnables.add(runnable);
-        if( targetQueue!=null && lastSize == 0 && suspendCounter.get()<=0
) {
+        if( lastSize == 0 && suspendCounter.get()<=0 ) {
             targetQueue.dispatchAsync(this);
         }
     }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/test/java/org/apache/activemq/actor/ActorTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/test/java/org/apache/activemq/actor/ActorTest.java?rev=887448&r1=887447&r2=887448&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/test/java/org/apache/activemq/actor/ActorTest.java
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dispatcher/src/test/java/org/apache/activemq/actor/ActorTest.java
Fri Dec  4 23:25:30 2009
@@ -7,8 +7,6 @@
  **************************************************************************************/
 package org.apache.activemq.actor;
 
-import static java.lang.String.format;
-
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -16,7 +14,6 @@
 
 import org.apache.activemq.dispatch.DispatchQueue;
 import org.apache.activemq.dispatch.DispatchSPI;
-import org.apache.activemq.dispatch.DispatchSystem;
 import org.apache.activemq.dispatch.internal.advanced.AdvancedDispatchSPI;
 
 



Mime
View raw message