tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r585541 - /tomcat/sandbox/gdev6x/java/org/apache/catalina/core/StandardThreadExecutor.java
Date Wed, 17 Oct 2007 15:41:22 GMT
Author: fhanik
Date: Wed Oct 17 08:41:20 2007
New Revision: 585541

URL: http://svn.apache.org/viewvc?rev=585541&view=rev
Log:
http://issues.apache.org/bugzilla/show_bug.cgi?id=43642

Modified:
    tomcat/sandbox/gdev6x/java/org/apache/catalina/core/StandardThreadExecutor.java

Modified: tomcat/sandbox/gdev6x/java/org/apache/catalina/core/StandardThreadExecutor.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/java/org/apache/catalina/core/StandardThreadExecutor.java?rev=585541&r1=585540&r2=585541&view=diff
==============================================================================
--- tomcat/sandbox/gdev6x/java/org/apache/catalina/core/StandardThreadExecutor.java (original)
+++ tomcat/sandbox/gdev6x/java/org/apache/catalina/core/StandardThreadExecutor.java Wed Oct
17 08:41:20 2007
@@ -19,6 +19,7 @@
 
 import java.util.Collection;
 import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -28,7 +29,6 @@
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.util.LifecycleSupport;
-import java.util.concurrent.RejectedExecutionException;
 
 public class StandardThreadExecutor implements Executor {
     
@@ -52,6 +52,8 @@
     protected AtomicInteger activeCount = new AtomicInteger(0);
     
     private LifecycleSupport lifecycle = new LifecycleSupport(this);
+    
+    protected boolean prestartminSpareThreads = false;
     // ---------------------------------------------- Constructors
     public StandardThreadExecutor() {
         //empty constructor for the digester
@@ -74,6 +76,10 @@
                 activeCount.addAndGet(-1);
             }
         };
+        if (prestartminSpareThreads) {
+            executor.prestartAllCoreThreads();
+        }
+
         taskqueue.setParent( (ThreadPoolExecutor) executor);
         lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
     }
@@ -127,6 +133,10 @@
         return name;
     }
 
+    public boolean isPrestartminSpareThreads() {
+        return prestartminSpareThreads;
+    }
+
     public void setThreadPriority(int threadPriority) {
         this.threadPriority = threadPriority;
     }
@@ -154,7 +164,11 @@
     public void setName(String name) {
         this.name = name;
     }
-    
+
+    public void setPrestartminSpareThreads(boolean prestartminSpareThreads) {
+        this.prestartminSpareThreads = prestartminSpareThreads;
+    }
+
     /**
      * Add a LifecycleEvent listener to this component.
      *



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


Mime
View raw message