This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.commons.threads-3.1.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-threads.git

commit 33781d016354b5d21798540e775a1644c2626ced
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Wed Oct 6 13:18:57 2010 +0000

    SLING-1819 : Unused custom thread pool is never removed
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/threads@1005021 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/commons/threads/impl/DefaultThreadPoolManager.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
 
b/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
index 318e2cc..b99c653 100644
--- 
a/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
+++ 
b/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
@@ -24,9 +24,9 @@ import java.util.UUID;
 import org.apache.sling.commons.threads.ModifiableThreadPoolConfig;
 import org.apache.sling.commons.threads.ThreadPool;
 import org.apache.sling.commons.threads.ThreadPoolConfig;
-import org.apache.sling.commons.threads.ThreadPoolManager;
 import org.apache.sling.commons.threads.ThreadPoolConfig.ThreadPoolPolicy;
 import org.apache.sling.commons.threads.ThreadPoolConfig.ThreadPriority;
+import org.apache.sling.commons.threads.ThreadPoolManager;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.service.cm.ConfigurationException;
@@ -140,6 +140,9 @@ public class DefaultThreadPoolManager
                 final Entry entry = this.pools.get(pool.getName());
                 if ( entry != null ) {
                     entry.decUsage();
+                    if ( !entry.isUsed() ) {
+                        this.pools.remove(pool.getName());
+                    }
                 }
             }
         }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to