Author: toad
Date: 2007-08-11 14:22:55 +0000 (Sat, 11 Aug 2007)
New Revision: 14603

Modified:
   trunk/freenet/src/freenet/support/Executor.java
   trunk/freenet/src/freenet/support/PooledExecutor.java
Log:
Extend the API to support job names

Modified: trunk/freenet/src/freenet/support/Executor.java
===================================================================
--- trunk/freenet/src/freenet/support/Executor.java     2007-08-11 13:54:33 UTC 
(rev 14602)
+++ trunk/freenet/src/freenet/support/Executor.java     2007-08-11 14:22:55 UTC 
(rev 14603)
@@ -9,6 +9,6 @@
 public interface Executor {

        /** Execute a job. */
-       public void execute(Runnable job);
+       public void execute(Runnable job, String jobName);

 }

Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java       2007-08-11 
13:54:33 UTC (rev 14602)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java       2007-08-11 
14:22:55 UTC (rev 14603)
@@ -19,7 +19,7 @@
        /** Maximum time a thread will wait for a job */
        static final int TIMEOUT = 5*60*1000;

-       public void execute(Runnable job) {
+       public void execute(Runnable job, String jobName) {
                while(true) {
                        MyThread t;
                        boolean mustStart = false;
@@ -39,6 +39,7 @@
                                if(!mustStart)
                                        t.notify();
                        }
+                       t.setName(jobName);
                        if(mustStart) {
                                t.start();
                                synchronized(this) {


Reply via email to