Author: fhanik
Date: Fri Nov 21 08:31:45 2008
New Revision: 719626
URL: http://svn.apache.org/viewvc?rev=719626&view=rev
Log:
Fix dynamic thread resizing
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=719626&r1=719625&r2=719626&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri Nov 21
08:31:45 2008
@@ -354,8 +354,14 @@
public void setMaxThreads(int maxThreads) {
this.maxThreads = maxThreads;
if (running) {
- synchronized(workers) {
- workers.resize(maxThreads);
+ if (getUseExecutor() && executor!=null) {
+ if (executor instanceof ThreadPoolExecutor) {
+
((ThreadPoolExecutor)executor).setMaximumPoolSize(maxThreads);
+ }
+ }else if (workers!=null){
+ synchronized(workers) {
+ workers.resize(maxThreads);
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]