Author: nextgens
Date: 2009-01-27 14:48:45 +0000 (Tue, 27 Jan 2009)
New Revision: 25313
Modified:
trunk/freenet/src/freenet/node/NodeStats.java
trunk/freenet/src/freenet/support/Executor.java
trunk/freenet/src/freenet/support/PooledExecutor.java
Log:
DOH
Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java 2009-01-27 14:45:49 UTC
(rev 25312)
+++ trunk/freenet/src/freenet/node/NodeStats.java 2009-01-27 14:48:45 UTC
(rev 25313)
@@ -1014,7 +1014,7 @@
}
public int getActiveThreadCount() {
- return rootThreadGroup.activeCount() -
node.executor.getWaitingThreadsCounter();
+ return rootThreadGroup.activeCount() -
node.executor.getWaitingThreadsCount();
}
public int[] getActiveThreadsByPriority() {
Modified: trunk/freenet/src/freenet/support/Executor.java
===================================================================
--- trunk/freenet/src/freenet/support/Executor.java 2009-01-27 14:45:49 UTC
(rev 25312)
+++ trunk/freenet/src/freenet/support/Executor.java 2009-01-27 14:48:45 UTC
(rev 25313)
@@ -18,5 +18,5 @@
public int[] runningThreads();
/** Fast method returning how many threads are waiting */
- public int getWaitingThreadsCounter();
+ public int getWaitingThreadsCount();
}
Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java 2009-01-27
14:45:49 UTC (rev 25312)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java 2009-01-27
14:48:45 UTC (rev 25313)
@@ -22,7 +22,7 @@
/** Threads waiting for a job */
@SuppressWarnings("unchecked")
private final ArrayList<MyThread>[] waitingThreads = new
ArrayList[runningThreads.length];
- private volatile int waitingThreadsCounter;
+ private volatile int waitingThreadsCount;
long[] threadCounter = new long[runningThreads.length];
private long jobCount;
private long jobMisses;
@@ -40,7 +40,7 @@
waitingThreads[i] = new ArrayList<MyThread>();
threadCounter[i] = 0;
}
- waitingThreadsCounter = 0;
+ waitingThreadsCount = 0;
}
/** Maximum time a thread will wait for a job */
static final int TIMEOUT = 5 * 60 * 1000;
@@ -70,7 +70,7 @@
jobCount++;
if(!waitingThreads[prio - 1].isEmpty()) {
t = waitingThreads[prio -
1].remove(waitingThreads[prio - 1].size() - 1);
- waitingThreadsCounter--;
+ waitingThreadsCount--;
if(logMINOR)
Logger.minor(this, "Reusing
thread " + t);
} else {
@@ -134,8 +134,8 @@
return result;
}
- public int getWaitingThreadsCounter() {
- return waitingThreadsCounter;
+ public int getWaitingThreadsCount() {
+ return waitingThreadsCount;
}
class MyThread extends NativeThread {
@@ -167,7 +167,7 @@
if(job == null) {
synchronized(PooledExecutor.this) {
waitingThreads[nativePriority -
1].add(this);
- waitingThreadsCounter++;
+ waitingThreadsCount++;
}
synchronized(this) {
if(nextJob == null) {
@@ -185,7 +185,7 @@
}
synchronized(PooledExecutor.this) {
waitingThreads[nativePriority -
1].remove(this);
- waitingThreadsCounter--;
+ waitingThreadsCount--;
if(!alive) {
runningThreads[nativePriority - 1].remove(this);
if(logMINOR)
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs