tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1828410 - in /tomcat/trunk/java/org/apache/catalina/tribes/transport: AbstractRxTask.java RxTaskPool.java bio/BioReceiver.java bio/BioReplicationTask.java
Date Thu, 05 Apr 2018 09:59:40 GMT
Author: markt
Date: Thu Apr  5 09:59:40 2018
New Revision: 1828410

URL: http://svn.apache.org/viewvc?rev=1828410&view=rev
Log:
As of r487420, the RxTask implementations don't implement run() as loop with a call to wait().
Clean-up some left-over syncs and notify() calls.

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/transport/AbstractRxTask.java
    tomcat/trunk/java/org/apache/catalina/tribes/transport/RxTaskPool.java
    tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReceiver.java
    tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReplicationTask.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/AbstractRxTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/AbstractRxTask.java?rev=1828410&r1=1828409&r2=1828410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/AbstractRxTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/AbstractRxTask.java Thu Apr  5
09:59:40 2018
@@ -26,6 +26,7 @@ public abstract class AbstractRxTask imp
 
     private ListenCallback callback;
     private RxTaskPool pool;
+    @Deprecated
     private boolean doRun = true;
     private int options;
     protected boolean useBufferPool = true;
@@ -46,6 +47,14 @@ public abstract class AbstractRxTask imp
         this.callback = callback;
     }
 
+    /**
+     * Sets doRun field which is unused.
+     *
+     * @param doRun New value
+     *
+     * @deprecated Will be removed in Tomcat 10
+     */
+    @Deprecated
     public void setDoRun(boolean doRun) {
         this.doRun = doRun;
     }
@@ -62,14 +71,20 @@ public abstract class AbstractRxTask imp
         return callback;
     }
 
+    /**
+     * Gets doRun field which is unused.
+     *
+     * @return Current field value
+     *
+     * @deprecated Will be removed in Tomcat 10
+     */
+    @Deprecated
     public boolean isDoRun() {
         return doRun;
     }
 
-    public void close()
-    {
+    public void close() {
         doRun = false;
-        notify();
     }
 
     public void setUseBufferPool(boolean usebufpool) {

Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/RxTaskPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/RxTaskPool.java?rev=1828410&r1=1828409&r2=1828410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/RxTaskPool.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/RxTaskPool.java Thu Apr  5 09:59:40
2018
@@ -105,14 +105,12 @@ public class RxTaskPool {
                 //if ( idle.size() < minThreads && !idle.contains(worker)) idle.add(worker);
                 if ( idle.size() < maxTasks && !idle.contains(worker)) idle.add(worker);
//let max be the upper limit
                 else {
-                    worker.setDoRun(false);
-                    synchronized (worker){worker.notify();}
+                    worker.close();
                 }
-                mutex.notify();
+                mutex.notifyAll();
             }
-        }else {
-            worker.setDoRun(false);
-            synchronized (worker){worker.notify();}
+        } else {
+            worker.close();
         }
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReceiver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReceiver.java?rev=1828410&r1=1828409&r2=1828410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReceiver.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReceiver.java Thu Apr  5
09:59:40 2018
@@ -130,9 +130,9 @@ public class BioReceiver extends Receive
                 if ( doListen() ) throw x;
             }
             if ( !doListen() ) {
-                task.setDoRun(false);
                 task.serviceSocket(null,null);
                 getExecutor().execute(task);
+                task.close();
                 break; //regular shutdown
             }
             if ( socket == null ) continue;

Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReplicationTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReplicationTask.java?rev=1828410&r1=1828409&r2=1828410&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReplicationTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/BioReplicationTask.java Thu
Apr  5 09:59:40 2018
@@ -168,7 +168,6 @@ public class BioReplicationTask extends
 
     @Override
     public void close() {
-        setDoRun(false);
         try {
             socket.close();
         }catch (Exception e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message