Author: nextgens
Date: 2008-08-10 17:00:14 +0000 (Sun, 10 Aug 2008)
New Revision: 21720
Modified:
trunk/freenet/src/freenet/support/PooledExecutor.java
trunk/freenet/src/freenet/support/io/NativeThread.java
Log:
trivial
Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java 2008-08-10
15:37:41 UTC (rev 21719)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java 2008-08-10
17:00:14 UTC (rev 21720)
@@ -16,9 +16,9 @@
public class PooledExecutor implements Executor {
/** All threads running or waiting */
- private final ArrayList[] runningThreads /* <MyThread> */ = new
ArrayList[NativeThread.JAVA_PRIORITY_RANGE + 1];
+ private final ArrayList<MyThread>[] runningThreads = new
ArrayList[NativeThread.JAVA_PRIORITY_RANGE + 1];
/** Threads waiting for a job */
- private final ArrayList[] waitingThreads /* <MyThread> */ = new
ArrayList[runningThreads.length];
+ private final ArrayList<MyThread>[] waitingThreads = new
ArrayList[runningThreads.length];
long[] threadCounter = new long[runningThreads.length];
private long jobCount;
private long jobMisses;
@@ -64,7 +64,7 @@
synchronized(this) {
jobCount++;
if(!waitingThreads[prio - 1].isEmpty()) {
- t = (MyThread) waitingThreads[prio -
1].remove(waitingThreads[prio - 1].size() - 1);
+ t = waitingThreads[prio -
1].remove(waitingThreads[prio - 1].size() - 1);
if(logMINOR)
Logger.minor(this, "Reusing
thread " + t);
} else {
@@ -140,6 +140,7 @@
threadNo = threadCounter;
}
+ @Override
public void run() {
super.run();
long ranJobs = 0;
Modified: trunk/freenet/src/freenet/support/io/NativeThread.java
===================================================================
--- trunk/freenet/src/freenet/support/io/NativeThread.java 2008-08-10
15:37:41 UTC (rev 21719)
+++ trunk/freenet/src/freenet/support/io/NativeThread.java 2008-08-10
17:00:14 UTC (rev 21720)
@@ -4,7 +4,6 @@
package freenet.support.io;
-import java.io.File;
import freenet.node.NodeStarter;
import freenet.support.LibraryLoader;
import freenet.support.Logger;
@@ -93,6 +92,7 @@
*/
private static native int getLinuxPriority();
+ @Override
public void run() {
if(!setNativePriority(currentPriority))
System.err.println("setNativePriority("+currentPriority+") has failed!");