minor tweaks
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 16 Mar 2007 19:56:05 +0000 (19:56 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 16 Mar 2007 19:56:05 +0000 (19:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@519115 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/NioEndpoint.java

index f9890c8..48476ae 100644 (file)
@@ -712,7 +712,7 @@ public class NioEndpoint {
                     executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), 60, TimeUnit.SECONDS,taskqueue, tf);
                     taskqueue.setParent( (ThreadPoolExecutor) executor);
                 }
-            } else {
+            } else if ( executor != null ) {//avoid two thread pools being created
                 workers = new WorkerStack(maxThreads);
             }
 
@@ -1898,7 +1898,7 @@ public class NioEndpoint {
         }
         
         public boolean offer(Runnable o) {
-            if ( parent != null && parent.getPoolSize()<parent.getMaximumPoolSize() ) return false;
+            if ( parent != null && parent.getPoolSize()<parent.getMaximumPoolSize() ) return false;//force creation of new threads
             else return super.offer(o);
         }
     }
@@ -1917,7 +1917,7 @@ public class NioEndpoint {
 
         public Thread newThread(Runnable r) {
             Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement());
-            t.setDaemon(true);
+            t.setDaemon(daemon);
             t.setPriority(getThreadPriority());
             return t;
         }