jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1032573 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DynamicPooledExecutor.java
Date Mon, 08 Nov 2010 14:04:13 GMT
Author: thomasm
Date: Mon Nov  8 14:04:12 2010
New Revision: 1032573

URL: http://svn.apache.org/viewvc?rev=1032573&view=rev
Log:
JCR-2808 Hop 0 sample app doesn't exit because of on-daemon thread pool-1-thread-1

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DynamicPooledExecutor.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DynamicPooledExecutor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DynamicPooledExecutor.java?rev=1032573&r1=1032572&r2=1032573&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DynamicPooledExecutor.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DynamicPooledExecutor.java
Mon Nov  8 14:04:12 2010
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.core.query
 
 import java.util.concurrent.Executor;
 import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
@@ -42,10 +43,17 @@ public class DynamicPooledExecutor imple
      * Creates a new DynamicPooledExecutor.
      */
     public DynamicPooledExecutor() {
+        ThreadFactory f = new ThreadFactory() {
+            public Thread newThread(Runnable r) {
+                Thread t = new Thread(r, "DynamicPooledExecutor");
+                t.setDaemon(true);
+                return t;
+            }
+        };
         this.executor = new ThreadPoolExecutor(
                 1, Runtime.getRuntime().availableProcessors(),
                 500, TimeUnit.MILLISECONDS,
-                new LinkedBlockingQueue<Runnable>());
+                new LinkedBlockingQueue<Runnable>(), f);
         this.lastCheck = System.currentTimeMillis();
     }
 



Mime
View raw message