Author: nextgens
Date: 2008-02-21 03:28:09 +0000 (Thu, 21 Feb 2008)
New Revision: 18091
Modified:
trunk/freenet/src/freenet/node/NodeStats.java
trunk/freenet/src/freenet/support/PooledExecutor.java
trunk/freenet/src/freenet/support/io/NativeThread.java
trunk/freenet/test/freenet/support/URIPreEncoderTest.java
Log:
JAVA_PRIO_RANGE => JAVA_PRIORITY_RANGE
Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java 2008-02-21 03:20:30 UTC
(rev 18090)
+++ trunk/freenet/src/freenet/node/NodeStats.java 2008-02-21 03:28:09 UTC
(rev 18091)
@@ -164,8 +164,8 @@
// ThreadCounting stuffs
public final ThreadGroup rootThreadGroup;
- private int[] activeThreadsByPriorities = new
int[NativeThread.JAVA_PRIO_RANGE];
- private int[] waitingThreadsByPriorities = new
int[NativeThread.JAVA_PRIO_RANGE];
+ private int[] activeThreadsByPriorities = new
int[NativeThread.JAVA_PRIORITY_RANGE];
+ private int[] waitingThreadsByPriorities = new
int[NativeThread.JAVA_PRIORITY_RANGE];
private int threadLimit;
// Free heap memory threshold stuffs
Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java 2008-02-21
03:20:30 UTC (rev 18090)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java 2008-02-21
03:28:09 UTC (rev 18091)
@@ -15,7 +15,7 @@
*/
public class PooledExecutor implements Executor {
- private final ArrayList[] runningThreads /* <MyThread> */ = new
ArrayList[NativeThread.JAVA_PRIO_RANGE + 1];
+ private final ArrayList[] runningThreads /* <MyThread> */ = new
ArrayList[NativeThread.JAVA_PRIORITY_RANGE + 1];
private final ArrayList[] waitingThreads /* <MyThread> */ = new
ArrayList[runningThreads.length];
long[] threadCounter = new long[runningThreads.length];
private long jobCount;
Modified: trunk/freenet/src/freenet/support/io/NativeThread.java
===================================================================
--- trunk/freenet/src/freenet/support/io/NativeThread.java 2008-02-21
03:20:30 UTC (rev 18090)
+++ trunk/freenet/src/freenet/support/io/NativeThread.java 2008-02-21
03:28:09 UTC (rev 18091)
@@ -21,7 +21,7 @@
public class NativeThread extends Thread {
public static final boolean _loadNative;
private static boolean _disabled;
- public static final int JAVA_PRIO_RANGE = Thread.MAX_PRIORITY -
Thread.MIN_PRIORITY;
+ public static final int JAVA_PRIORITY_RANGE = Thread.MAX_PRIORITY -
Thread.MIN_PRIORITY;
private static int NATIVE_PRIORITY_BASE;
public static int NATIVE_PRIORITY_RANGE;
private int currentPriority = Thread.MAX_PRIORITY;
@@ -51,7 +51,7 @@
// they are 3 main prio levels
HAS_THREE_NICE_LEVELS = NATIVE_PRIORITY_RANGE >= 3;
HAS_ENOUGH_NICE_LEVELS = NATIVE_PRIORITY_RANGE >=
ENOUGH_NICE_LEVELS;
- HAS_PLENTY_NICE_LEVELS = NATIVE_PRIORITY_RANGE
>=JAVA_PRIO_RANGE;
+ HAS_PLENTY_NICE_LEVELS = NATIVE_PRIORITY_RANGE
>=JAVA_PRIORITY_RANGE;
if(!(HAS_ENOUGH_NICE_LEVELS && HAS_THREE_NICE_LEVELS))
System.err.println("WARNING!!! The JVM has been
niced down to a level which won't allow it to schedule threads properly! LOWER
THE NICE LEVEL!!");
} else {
@@ -168,7 +168,7 @@
new NullPointerException().printStackTrace();
return false;
}
- final int linuxPriority = NATIVE_PRIORITY_BASE +
NATIVE_PRIORITY_RANGE - (NATIVE_PRIORITY_RANGE * (prio - MIN_PRIORITY)) /
JAVA_PRIO_RANGE;
+ final int linuxPriority = NATIVE_PRIORITY_BASE +
NATIVE_PRIORITY_RANGE - (NATIVE_PRIORITY_RANGE * (prio - MIN_PRIORITY)) /
JAVA_PRIORITY_RANGE;
if(linuxPriority == realPrio) return true; // Ok
// That's an obvious coding mistake
if(prio < currentPriority)
Modified: trunk/freenet/test/freenet/support/URIPreEncoderTest.java
===================================================================
--- trunk/freenet/test/freenet/support/URIPreEncoderTest.java 2008-02-21
03:20:30 UTC (rev 18090)
+++ trunk/freenet/test/freenet/support/URIPreEncoderTest.java 2008-02-21
03:28:09 UTC (rev 18091)
@@ -34,7 +34,7 @@
eachChar = aString.charAt(i);
if (URIPreEncoder.allowedChars.indexOf(eachChar) < 0)
return false;
- };
+ }
return true;
}