activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r920330 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
Date Mon, 08 Mar 2010 14:19:41 GMT
Author: chirino
Date: Mon Mar  8 14:19:40 2010
New Revision: 920330

URL: http://svn.apache.org/viewvc?rev=920330&view=rev
Log:
check for release after processig io tasks

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java?rev=920330&r1=920329&r2=920330&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
Mon Mar  8 14:19:40 2010
@@ -68,15 +68,18 @@
         selector.wakeup();
     }
     
-    private void processIoTasks() {
+    private boolean processIoTasks() {
+        boolean rc = false;
         Runnable task; 
         while( (task= ioTasks.poll()) !=null ) {
             try {
+                rc = true;
                 task.run();
             } catch (Throwable e) {
                 e.printStackTrace();
             }
         }
+        return rc;
     }
 
     
@@ -88,7 +91,9 @@
             Thread.currentThread().setName("Selector Worker: " + id);
             while (!isReleased()) {
                 
-                processIoTasks();
+                if( processIoTasks() ) {
+                    continue;
+                }
                 int count = selector.select(10);
                 if (count == 0) {
                     continue;



Mime
View raw message