tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1519384 - in /tomcat/trunk/java/org/apache/catalina/tribes: group/interceptors/MessageDispatch15Interceptor.java util/TcclThreadFactory.java
Date Mon, 02 Sep 2013 10:45:02 GMT
Author: kfujino
Date: Mon Sep  2 10:45:02 2013
New Revision: 1519384

URL: http://svn.apache.org/r1519384
Log:
More definite thread name for MessageDispatch15Interceptor.

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/MessageDispatch15Interceptor.java
    tomcat/trunk/java/org/apache/catalina/tribes/util/TcclThreadFactory.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/MessageDispatch15Interceptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/MessageDispatch15Interceptor.java?rev=1519384&r1=1519383&r2=1519384&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/MessageDispatch15Interceptor.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/MessageDispatch15Interceptor.java
Mon Sep  2 10:45:02 2013
@@ -83,7 +83,8 @@ public class MessageDispatch15Intercepto
     public void startQueue() {
         if ( run ) return;
         executor = ExecutorFactory.newThreadPool(maxSpareThreads, maxThreads,
-                keepAliveTime, TimeUnit.MILLISECONDS, new TcclThreadFactory());
+                keepAliveTime, TimeUnit.MILLISECONDS,
+                new TcclThreadFactory("MessageDispatch15Interceptor.MessageDispatchThread"));
         run = true;
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/tribes/util/TcclThreadFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/util/TcclThreadFactory.java?rev=1519384&r1=1519383&r2=1519384&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/util/TcclThreadFactory.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/util/TcclThreadFactory.java Mon Sep  2 10:45:02
2013
@@ -39,15 +39,18 @@ public class TcclThreadFactory implement
     private final String namePrefix;
 
     public TcclThreadFactory() {
+        this("pool-" + poolNumber.getAndIncrement() + "-thread-");
+    }
+
+    public TcclThreadFactory(String namePrefix) {
         SecurityManager s = System.getSecurityManager();
         group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
-        namePrefix = "pool-" + poolNumber.getAndIncrement() + "-thread-";
+        this.namePrefix = namePrefix;
     }
 
     @Override
     public Thread newThread(Runnable r) {
-        final Thread t = new Thread(group, r, namePrefix +
-                threadNumber.getAndIncrement());
+        final Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement());
 
         if (IS_SECURITY_ENABLED) {
             AccessController.doPrivileged(new PrivilegedAction<Void>() {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message