public class ThreadMonitor
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Method and Description |
|---|---|
void |
run()
Sleep until the specified timout amount and then
interrupt the thread being monitored.
|
static java.lang.Thread |
start(long timeout)
Start monitoring the current thread.
|
static java.lang.Thread |
start(java.lang.Thread thread,
long timeout)
Start monitoring the specified thread.
|
static void |
stop(java.lang.Thread thread)
Stop monitoring the specified thread.
|
public static java.lang.Thread start(long timeout)
timeout - The timout amount in milliseconds
or no timeout if the value is zero or lessnull
if the timout amount is not greater than zeropublic static java.lang.Thread start(java.lang.Thread thread,
long timeout)
thread - The thread The thread to monitortimeout - The timout amount in milliseconds
or no timeout if the value is zero or lessnull
if the timout amount is not greater than zeropublic static void stop(java.lang.Thread thread)
thread - The monitor thread, may be nullpublic void run()
run in interface java.lang.RunnableRunnable.run()