net.i2p.util
Class I2PThread
java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- DHSessionKeyBuilder.PrecalcRunner, I2PAppThread, JobQueueRunner
public class I2PThread
- extends Thread
In case its useful later...
(e.g. w/ native programatic thread dumping, etc)
As of 0.9.21, I2PThreads are initialized to NORM_PRIORITY
(not the priority of the creating thread).
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
I2PThread
public I2PThread()
I2PThread
public I2PThread(String name)
I2PThread
public I2PThread(Runnable r)
I2PThread
public I2PThread(Runnable r,
String name)
I2PThread
public I2PThread(Runnable r,
String name,
boolean isDaemon)
I2PThread
public I2PThread(ThreadGroup g,
Runnable r)
start
public void start()
- Overridden to provide useful info to users on OOM, and to prevent
shutting down the whole JVM for what is most likely not a heap issue.
If the calling thread is an I2PThread an OOM would shut down the JVM.
Telling the user to increase the heap size may make the problem worse.
We may be able to continue without this thread, particularly in app context.
- Overrides:
start
in class Thread
- Since:
- 0.9.20
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
fireOOM
protected void fireOOM(OutOfMemoryError oom)
- protected void finalize() throws Throwable {
//log(Log.DEBUG, "Thread finalized: " + _name);
super.finalize();
}
addOOMEventListener
public static void addOOMEventListener(I2PThread.OOMEventListener lsnr)
- register a new component that wants notification of OOM events
removeOOMEventListener
public static void removeOOMEventListener(I2PThread.OOMEventListener lsnr)
- unregister a component that wants notification of OOM events