diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java index 21cf31ed023f0b9aa3e3409e98f56e69131261e3..e63cd9878358bd6c992a9103008fa71206ba2ec3 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java @@ -21,6 +21,7 @@ import net.i2p.client.streaming.I2PSocketOptions; import net.i2p.data.Destination; import net.i2p.util.EventDispatcher; import net.i2p.util.Log; +import net.i2p.util.I2PThread; public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runnable { @@ -73,7 +74,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask if (sockMgr == null) throw new NullPointerException(); l.log("I2P session created"); - Thread t = new Thread(this); + Thread t = new I2PThread(this); t.setName("Client"); listenerReady=false; t.start(); @@ -270,7 +271,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask } } - public class ClientConnectionRunner extends Thread { + public class ClientConnectionRunner extends I2PThread { private Socket s; public ClientConnectionRunner(Socket s, String name) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 5914410cc5f48d348103892c04ff7ecd7ff0992f..da1024fcc581b244e802f8e8d558c3c59b5107f8 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -208,6 +208,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase _targetRequest = targetRequest; _useWWWProxy = useWWWProxy; _disabled = false; + setName("InactivityThread"); } public void disable() { _disabled = true; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java index ca39bf401f737847d4b19863c562e08181ea2ce3..00425359590c482423b17dbdab6642149ae3d51f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java @@ -15,8 +15,9 @@ import net.i2p.client.I2PSession; import net.i2p.client.streaming.I2PSocket; import net.i2p.util.Log; import net.i2p.util.Clock; +import net.i2p.util.I2PThread; -public class I2PTunnelRunner extends Thread { +public class I2PTunnelRunner extends I2PThread { private final static Log _log = new Log(I2PTunnelRunner.class); /** @@ -121,7 +122,7 @@ public class I2PTunnelRunner extends Thread { } } - private class StreamForwarder extends Thread { + private class StreamForwarder extends I2PThread { InputStream in; OutputStream out; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java index 1711baae9b4cb20d10b72c071fd0bc7d997e81f1..acc6a5082ce15676a5e18ed5dee60f9e41a1b54f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java @@ -23,6 +23,7 @@ import net.i2p.client.streaming.I2PSocketManagerFactory; import net.i2p.data.Base64; import net.i2p.util.EventDispatcher; import net.i2p.util.Log; +import net.i2p.util.I2PThread; public class I2PTunnelServer extends I2PTunnelTask implements Runnable { @@ -82,7 +83,7 @@ public class I2PTunnelServer extends I2PTunnelTask l.log("Ready!"); notifyEvent("openServerResult", "ok"); open=true; - Thread t = new Thread(this); + Thread t = new I2PThread(this); t.setName("Server"); t.start(); } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java index 49b5be5b3e10d3e8752e84505a593214859fc830..48f0b16b152a908e196b36f7ca7faa61c04c9b81 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java @@ -15,6 +15,7 @@ import net.i2p.client.streaming.I2PSocketManager; import net.i2p.data.Destination; import net.i2p.util.EventDispatcher; import net.i2p.util.Log; +import net.i2p.util.I2PThread; public class I2Ping extends I2PTunnelTask implements Runnable { private final static Log _log = new Log(I2Ping.class); @@ -58,7 +59,7 @@ public class I2Ping extends I2PTunnelTask implements Runnable { sockMgr = I2PTunnelClient.getSocketManager(); } } - Thread t = new Thread(this); + Thread t = new I2PThread(this); t.setName("Client"); t.start(); open=true; @@ -180,7 +181,7 @@ public class I2Ping extends I2PTunnelTask implements Runnable { - public class PingHandler extends Thread { + public class PingHandler extends I2PThread { private String destination; public PingHandler(String dest) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelManager.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelManager.java index dda9a2219de35caf984474f8c2999b25e22c5b0a..f314fb3112dc8057d1293068bd9baab05b3a4240 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelManager.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelManager.java @@ -192,7 +192,7 @@ public class TunnelManager implements Runnable { } TunnelManager mgr = new TunnelManager(host, port); - Thread t = new Thread(mgr, "Listener"); + Thread t = new I2PThread(mgr, "Listener"); t.start(); } diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java index 73303e15ba33024abcbd8fdc0ff883a3516d949d..0accb2a6ec193fba77912cb2bc0ce5848b514c8b 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java @@ -9,6 +9,7 @@ import net.i2p.I2PException; import net.i2p.client.I2PSessionException; import net.i2p.data.Destination; import net.i2p.util.Log; +import net.i2p.util.I2PThread; /** * Initial stub implementation for the socket @@ -227,13 +228,14 @@ class I2PSocketImpl implements I2PSocket { } } - public class I2PSocketRunner extends Thread { + public class I2PSocketRunner extends I2PThread { public InputStream in; public I2PSocketRunner(InputStream in) { _log.debug("Runner's input stream is: "+in.hashCode()); this.in=in; + setName("SocketRunner from " + I2PSocketImpl.this.remote.calculateHash().toBase64().substring(0, 4)); start(); } diff --git a/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java b/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java index 8ec981e26226d0d5707d80bc0250be44b6193b91..022218420fd69f6ae9886db41598d8f06e8df53d 100644 --- a/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java +++ b/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java @@ -14,6 +14,7 @@ import net.i2p.util.RandomSource; import net.i2p.util.Log; import net.i2p.util.NativeBigInteger; import net.i2p.util.Clock; +import net.i2p.util.I2PThread; import java.math.BigInteger; import java.util.ArrayList; @@ -84,7 +85,7 @@ public class DHSessionKeyBuilder { if (_log.shouldLog(Log.DEBUG)) _log.debug("DH Precalc (minimum: " + MIN_NUM_BUILDERS + " max: " + MAX_NUM_BUILDERS + ", delay: " + CALC_DELAY + ")"); - _precalcThread = new Thread(new DHSessionKeyBuilderPrecalcRunner(MIN_NUM_BUILDERS, MAX_NUM_BUILDERS)); + _precalcThread = new I2PThread(new DHSessionKeyBuilderPrecalcRunner(MIN_NUM_BUILDERS, MAX_NUM_BUILDERS)); _precalcThread.setName("DH Precalc"); _precalcThread.setDaemon(true); _precalcThread.setPriority(Thread.MIN_PRIORITY); diff --git a/core/java/src/net/i2p/crypto/YKGenerator.java b/core/java/src/net/i2p/crypto/YKGenerator.java index beb160c51a4273152c8663b88618b056f56ef970..39bc4be9c8acae85f40a3e2073f3f8ab0897af9c 100644 --- a/core/java/src/net/i2p/crypto/YKGenerator.java +++ b/core/java/src/net/i2p/crypto/YKGenerator.java @@ -14,6 +14,7 @@ import java.util.List; import net.i2p.util.Clock; import net.i2p.util.Log; +import net.i2p.util.I2PThread; import net.i2p.util.NativeBigInteger; import net.i2p.util.RandomSource; @@ -78,7 +79,7 @@ class YKGenerator { if (_log.shouldLog(Log.DEBUG)) _log.debug("ElGamal YK Precalc (minimum: " + MIN_NUM_BUILDERS + " max: " + MAX_NUM_BUILDERS + ", delay: " + CALC_DELAY + ")"); - _precalcThread = new Thread(new YKPrecalcRunner(MIN_NUM_BUILDERS, MAX_NUM_BUILDERS)); + _precalcThread = new I2PThread(new YKPrecalcRunner(MIN_NUM_BUILDERS, MAX_NUM_BUILDERS)); _precalcThread.setName("YK Precalc"); _precalcThread.setDaemon(true); _precalcThread.setPriority(Thread.MIN_PRIORITY);