This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new 9317827f7a Remove meaningless code
9317827f7a is described below
commit 9317827f7acaead4b203183c31526da331288f92
Author: lihan
AuthorDate: Sun May 8 19:32:59 2022 +0800
Remove meaningless code
---
.../org/apache/catalina/core/StandardThreadExecutor.java | 16
java/org/apache/catalina/core/mbeans-descriptors.xml | 4
webapps/docs/changelog.xml | 6 ++
webapps/docs/config/executor.xml | 4
4 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/java/org/apache/catalina/core/StandardThreadExecutor.java
b/java/org/apache/catalina/core/StandardThreadExecutor.java
index 2f8aaf4d2c..6e18c61852 100644
--- a/java/org/apache/catalina/core/StandardThreadExecutor.java
+++ b/java/org/apache/catalina/core/StandardThreadExecutor.java
@@ -74,11 +74,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
*/
protected String name;
-/**
- * prestart threads?
- */
-protected boolean prestartminSpareThreads = false;
-
/**
* The maximum number of elements that can queue up before we reject them
*/
@@ -121,9 +116,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
TaskThreadFactory tf = new
TaskThreadFactory(namePrefix,daemon,getThreadPriority());
executor = new ThreadPoolExecutor(getMinSpareThreads(),
getMaxThreads(), maxIdleTime, TimeUnit.MILLISECONDS,taskqueue, tf);
executor.setThreadRenewalDelay(threadRenewalDelay);
-if (prestartminSpareThreads) {
-executor.prestartAllCoreThreads();
-}
taskqueue.setParent(executor);
setState(LifecycleState.STARTING);
@@ -214,10 +206,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
return name;
}
-public boolean isPrestartminSpareThreads() {
-
-return prestartminSpareThreads;
-}
public void setThreadPriority(int threadPriority) {
this.threadPriority = threadPriority;
}
@@ -251,10 +239,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
}
}
-public void setPrestartminSpareThreads(boolean prestartminSpareThreads) {
-this.prestartminSpareThreads = prestartminSpareThreads;
-}
-
public void setName(String name) {
this.name = name;
}
diff --git a/java/org/apache/catalina/core/mbeans-descriptors.xml
b/java/org/apache/catalina/core/mbeans-descriptors.xml
index a04ccbe4af..6fa6a85a02 100644
--- a/java/org/apache/catalina/core/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/core/mbeans-descriptors.xml
@@ -1524,10 +1524,6 @@
type="int"
writeable="false" />
-
511.
(jfclere/markt)
+
+Remove the prestartminSpareThreads attribute of the
+StandardThreadExecutor since all core threads are always
+started by default making this attribute meaningless. Pull request
+510 provided by Aooohan. (markt)
+
diff --git a/webapps/docs/config/executor.xml b/webapps/docs/config/executor.xml
index b896a91587..05b1420b8e 100644
--- a/webapps/docs/config/executor.xml
+++ b/webapps/docs/config/executor.xml
@@ -107,10 +107,6 @@
(int) The maximum number of runnable tasks that can queue up awaiting
execution before we reject them. Default value is
Integer.MAX_VALUE
-
- (boolean) Whether minSpareThreads should be started when starting the
Executor or not,
- the default is false
-
(long) If a ThreadLocalLeakPreventionListener is configured,
it will notify this executor about stopped contexts.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org