continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1672214 - /continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
Date Wed, 08 Apr 2015 22:51:02 GMT
Author: batkinson
Date: Wed Apr  8 22:51:02 2015
New Revision: 1672214

URL: http://svn.apache.org/r1672214
Log:
Modified task executor to set meaningful thread names for better runtime diagnostics.

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java?rev=1672214&r1=1672213&r2=1672214&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
Wed Apr  8 22:51:02 2015
@@ -74,6 +74,13 @@ public class ParallelBuildsThreadedTaskQ
 
     private Task currentTask;
 
+    private int threadNum;
+
+    private synchronized int nextThreadNum()
+    {
+        return threadNum++;
+    }
+
     private class ExecutorRunnable
         extends Thread
     {
@@ -81,6 +88,11 @@ public class ParallelBuildsThreadedTaskQ
 
         private boolean done;
 
+        public ExecutorRunnable()
+        {
+            super( String.format( "%s-executor-%s", name, nextThreadNum() ) );
+        }
+
         public void run()
         {
             while ( command != SHUTDOWN )



Mime
View raw message