From: markt Date: Thu, 9 Apr 2009 09:13:28 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46997 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a40f8e0129281d330ae81a9931d6d78fca4b4fd4;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46997 Code clean up Patch provided by Jens Kapitza git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@763566 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/threads/TaskQueue.java b/java/org/apache/tomcat/util/threads/TaskQueue.java index 01d428c54..fc579e789 100644 --- a/java/org/apache/tomcat/util/threads/TaskQueue.java +++ b/java/org/apache/tomcat/util/threads/TaskQueue.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; * */ public class TaskQueue extends LinkedBlockingQueue { - ThreadPoolExecutor parent = null; + private ThreadPoolExecutor parent = null; public TaskQueue() { super(); @@ -59,15 +59,13 @@ public class TaskQueue extends LinkedBlockingQueue { } public boolean offer(Runnable o) { - //we can't do any checks - if (parent==null) return super.offer(o); - //we are maxed out on threads, simply queue the object - if (parent.getPoolSize() == parent.getMaximumPoolSize()) return super.offer(o); - //we have idle threads, just add it to the queue - if (parent.getActiveCount()<(parent.getPoolSize())) return super.offer(o); - //if we have less threads than maximum force creation of a new thread - if (parent.getPoolSize()