[freenet-cvs] r17920 - trunk/freenet/src/freenet/crypt

nextgens at freenetproject.org nextgens at freenetproject.org
Fri Feb 15 07:36:36 UTC 2008


Author: nextgens
Date: 2008-02-15 07:36:36 +0000 (Fri, 15 Feb 2008)
New Revision: 17920

Modified:
   trunk/freenet/src/freenet/crypt/DiffieHellman.java
Log:
DiffieHellman precalculation is a low-priority thread too

Modified: trunk/freenet/src/freenet/crypt/DiffieHellman.java
===================================================================
--- trunk/freenet/src/freenet/crypt/DiffieHellman.java	2008-02-15 07:33:49 UTC (rev 17919)
+++ trunk/freenet/src/freenet/crypt/DiffieHellman.java	2008-02-15 07:36:36 UTC (rev 17920)
@@ -11,6 +11,7 @@
 import java.util.Stack;
 
 import freenet.support.Logger;
+import freenet.support.io.NativeThread;
 import net.i2p.util.NativeBigInteger;
 
 public class DiffieHellman {
@@ -36,7 +37,7 @@
 	private static Stack precalcBuffer = new Stack();
 	private static Object precalcerWaitObj = new Object();
 
-	private static Thread precalcThread;
+	private static NativeThread precalcThread;
 	
 	public static final BigInteger MIN_EXPONENTIAL_VALUE = new BigInteger("2").pow(24);
 	public static final BigInteger MAX_EXPONENTIAL_VALUE = group.getP().subtract(MIN_EXPONENTIAL_VALUE);
@@ -45,10 +46,10 @@
 		precalcThread = new PrecalcBufferFill();
 	}
 
-	private static class PrecalcBufferFill extends Thread {
+	private static class PrecalcBufferFill extends NativeThread {
 
 		public PrecalcBufferFill() {
-			setName("Diffie-Hellman-Precalc");
+			super("Diffie-Hellman-Precalc", Thread.MIN_PRIORITY);
 			setDaemon(true);
 		}
 




More information about the cvs mailing list