continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1672216 - in /continuum/trunk: continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/
Date Wed, 08 Apr 2015 22:51:16 GMT
Author: batkinson
Date: Wed Apr  8 22:51:15 2015
New Revision: 1672216

URL: http://svn.apache.org/r1672216
Log:
Unified the way that executors name threads.

Modified:
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java

Modified: continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java?rev=1672216&r1=1672215&r2=1672216&view=diff
==============================================================================
--- continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
(original)
+++ continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
Wed Apr  8 22:51:15 2015
@@ -26,6 +26,7 @@ import edu.emory.mathcs.backport.java.ut
 import edu.emory.mathcs.backport.java.util.concurrent.Future;
 import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 import edu.emory.mathcs.backport.java.util.concurrent.TimeoutException;
+import org.apache.continuum.utils.ThreadNames;
 import org.codehaus.plexus.component.annotations.Configuration;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
@@ -79,6 +80,11 @@ public class ThreadedDistributedBuildTas
 
         private boolean done;
 
+        public ExecutorRunnable()
+        {
+            super( ThreadNames.formatNext( "%s-executor", name ) );
+        }
+
         public void run()
         {
             while ( command != SHUTDOWN )

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=1672216&r1=1672215&r2=1672216&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:15 2015
@@ -26,6 +26,7 @@ import edu.emory.mathcs.backport.java.ut
 import edu.emory.mathcs.backport.java.util.concurrent.Future;
 import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 import edu.emory.mathcs.backport.java.util.concurrent.TimeoutException;
+import org.apache.continuum.utils.ThreadNames;
 import org.codehaus.plexus.component.annotations.Configuration;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
@@ -74,13 +75,6 @@ public class ParallelBuildsThreadedTaskQ
 
     private Task currentTask;
 
-    private int threadNum;
-
-    private synchronized int nextThreadNum()
-    {
-        return threadNum++;
-    }
-
     private class ExecutorRunnable
         extends Thread
     {
@@ -90,7 +84,7 @@ public class ParallelBuildsThreadedTaskQ
 
         public ExecutorRunnable()
         {
-            super( String.format( "%s-executor-%s", name, nextThreadNum() ) );
+            super( ThreadNames.formatNext( "%s-executor", name ) );
         }
 
         public void run()



Mime
View raw message