Author: toad
Date: 2008-02-06 15:18:07 +0000 (Wed, 06 Feb 2008)
New Revision: 17591
Modified:
trunk/freenet/src/freenet/support/PooledExecutor.java
Log:
Add (thread number) to end of job name to further clarify
Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java 2008-02-06
15:15:25 UTC (rev 17590)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java 2008-02-06
15:18:07 UTC (rev 17591)
@@ -37,7 +37,7 @@
t = (MyThread)
waitingThreads.remove(waitingThreads.size()-1);
} else {
// Will be coalesced by thread count
listings if we use "@" or "for"
- t = new MyThread("Pooled thread
awaiting work @"+(threadCounter++));
+ t = new MyThread("Pooled thread
awaiting work @"+(threadCounter++), threadCounter);
t.setDaemon(true);
mustStart = true;
miss = true;
@@ -53,7 +53,7 @@
// level code. So we'd best use
notifyAll().
t.notifyAll();
}
- t.setName(jobName);
+ t.setName(jobName+"("+t.threadNo+")");
if(mustStart) {
t.start();
synchronized(this) {
@@ -77,10 +77,12 @@
final String defaultName;
boolean alive = true;
Runnable nextJob;
+ final long threadNo;
- public MyThread(String defaultName) {
+ public MyThread(String defaultName, long threadCounter) {
super(defaultName);
this.defaultName = defaultName;
+ threadNo = threadCounter;
}
public void run() {