mirror of https://github.com/apache/activemq.git
Make the default thread pool create deamon threads
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@360169 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
475925394a
commit
e7246d9327
|
@ -18,6 +18,7 @@ package org.apache.activemq.thread;
|
|||
|
||||
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 @@ import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecuto
|
|||
*/
|
||||
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() {
|
||||
|
|
Loading…
Reference in New Issue