I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 07b3c8a7 authored by zzz's avatar zzz
Browse files

* PRNG, LogWriter: Use I2PThread to catch OOM

parent 83fe6354
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import net.i2p.I2PAppContext; import net.i2p.I2PAppContext;
import net.i2p.util.I2PThread;
import net.i2p.util.Log; import net.i2p.util.Log;
/** /**
...@@ -53,7 +54,7 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl ...@@ -53,7 +54,7 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl
for (int i = 0; i < _bufferCount; i++) for (int i = 0; i < _bufferCount; i++)
_emptyBuffers.offer(new AsyncBuffer(_bufferSize)); _emptyBuffers.offer(new AsyncBuffer(_bufferSize));
_isRunning = true; _isRunning = true;
_refillThread = new Thread(this, "PRNG"); _refillThread = new I2PThread(this, "PRNG");
_refillThread.setDaemon(true); _refillThread.setDaemon(true);
_refillThread.setPriority(Thread.MIN_PRIORITY+1); _refillThread.setPriority(Thread.MIN_PRIORITY+1);
_refillThread.start(); _refillThread.start();
......
...@@ -159,8 +159,8 @@ public class LogManager { ...@@ -159,8 +159,8 @@ public class LogManager {
if (_writer != null) if (_writer != null)
return; return;
_writer = new LogWriter(this); _writer = new LogWriter(this);
// NOT an I2PThread, as it contains logging and we end up with problems // if you enable logging in I2PThread again, you MUST change this back to Thread
Thread t = new Thread(_writer, "LogWriter"); Thread t = new I2PThread(_writer, "LogWriter");
t.setDaemon(true); t.setDaemon(true);
t.start(); t.start();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment