activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r360169 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java
Date Fri, 30 Dec 2005 21:27:23 GMT
Author: chirino
Date: Fri Dec 30 13:27:21 2005
New Revision: 360169

URL: http://svn.apache.org/viewcvs?rev=360169&view=rev
Log:
Make the default thread pool create deamon threads

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java?rev=360169&r1=360168&r2=360169&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/thread/DefaultThreadPools.java
Fri Dec 30 13:27:21 2005
@@ -18,6 +18,7 @@
 
 import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;
 
 /**
  * 
@@ -25,7 +26,17 @@
  */
 public class DefaultThreadPools {
 
-    private static final Executor defaultPool = new ScheduledThreadPoolExecutor(5);
+    private static final Executor defaultPool;
+    static {
+        defaultPool = new ScheduledThreadPoolExecutor(5, new ThreadFactory() {
+            public Thread newThread(Runnable runnable) {
+                Thread thread = new Thread(runnable, "ActiveMQ Default Thread Pool Thread");
+                thread.setDaemon(true);
+                return thread;
+            }
+        });
+    }
+    
     private static final TaskRunnerFactory defaultTaskRunnerFactory = new TaskRunnerFactory(defaultPool,10);
     
     public static Executor getDeaultPool() {



Mime
View raw message