incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1005021 - /sling/trunk/bundles/commons/threads/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
Date Wed, 06 Oct 2010 13:18:57 GMT
Author: cziegeler
Date: Wed Oct  6 13:18:57 2010
New Revision: 1005021

URL: http://svn.apache.org/viewvc?rev=1005021&view=rev
Log:
SLING-1819 : Unused custom thread pool is never removed

Modified:
    sling/trunk/bundles/commons/threads/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java

Modified: sling/trunk/bundles/commons/threads/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/threads/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java?rev=1005021&r1=1005020&r2=1005021&view=diff
==============================================================================
--- sling/trunk/bundles/commons/threads/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
(original)
+++ sling/trunk/bundles/commons/threads/src/main/java/org/apache/sling/commons/threads/impl/DefaultThreadPoolManager.java
Wed Oct  6 13:18:57 2010
@@ -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());
+                    }
                 }
             }
         }



Mime
View raw message