cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1497977 - /cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
Date Sat, 29 Jun 2013 02:25:17 GMT
Author: gawor
Date: Sat Jun 29 02:25:17 2013
New Revision: 1497977

URL: http://svn.apache.org/r1497977
Log:
ensure threads are daemon threads

Modified:
    cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java?rev=1497977&r1=1497976&r2=1497977&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java Sat Jun 29 02:25:17 2013
@@ -50,6 +50,7 @@ import java.util.concurrent.CopyOnWriteA
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.xml.datatype.DatatypeFactory;
@@ -1145,7 +1146,13 @@ public class SiteExporter implements Run
                 maxThreads = modified.size();
             }
 
-            ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
+            ExecutorService executor = Executors.newFixedThreadPool(maxThreads, new ThreadFactory()
{
+                    public Thread newThread(Runnable r) {
+                        Thread t = new Thread(r);
+                        t.setDaemon(true);
+                        return t;
+                    }
+                });
             List<Future<?>> futures = new ArrayList<Future<?>>(modified.size());
             for (SiteExporter exporter : modified) {
                 futures.add(executor.submit(exporter));



Mime
View raw message