Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRIORITY |
static int |
MIN_PRIORITY |
static int |
NORM_PRIORITY |
Constructor and Description |
---|
Thread() |
Thread(Runnable runnable) |
Thread(Runnable runnable,
String name) |
Thread(String name) |
Thread(ThreadGroup tg,
Runnable r) |
Thread(ThreadGroup tg,
Runnable r,
String name) |
Thread(ThreadGroup tg,
String s) |
Modifier and Type | Method and Description |
---|---|
static Thread |
currentThread() |
ClassLoader |
getContextClassLoader() |
String |
getName() |
int |
getPriority() |
ThreadGroup |
getThreadGroup() |
void |
interrupt() |
static boolean |
interrupted()
Checks if the current Thread has been interrupted, and clears the interrupted flag of the Thread.
|
boolean |
isAlive() |
boolean |
isDaemon() |
boolean |
isInterrupted()
Checks this Thread to see if it has been interrupted.
|
void |
join()
Wait indefinitely for this Thread to die.
|
void |
join(long millis)
Wait for a specific number of milliseconds for this Thread to die.
|
void |
join(long millis,
int nanos)
Wait for a specific number of milliseconds and nanoseconds for this Thread to die.
|
void |
resume()
Deprecated.
|
void |
run() |
void |
setContextClassLoader(ClassLoader loader) |
void |
setDaemon(boolean on) |
void |
setName(String name) |
void |
setPriority(int p) |
static void |
sleep(long howLong) |
static void |
sleep(long howLong,
int nanos) |
void |
start() |
void |
stop()
Deprecated.
|
void |
stop(Throwable o)
Deprecated.
|
void |
suspend()
Deprecated.
|
static void |
yield() |
public static final int NORM_PRIORITY
public static final int MAX_PRIORITY
public static final int MIN_PRIORITY
public Thread()
public Thread(ThreadGroup tg, Runnable r, String name)
public Thread(Runnable runnable)
public Thread(String name)
public Thread(ThreadGroup tg, Runnable r)
public Thread(ThreadGroup tg, String s)
public final ThreadGroup getThreadGroup()
public final void setPriority(int p)
public final int getPriority()
public final String getName()
public final void setName(String name)
public static final Thread currentThread()
public final void interrupt()
public static final void sleep(long howLong) throws InterruptedException
InterruptedException
public static final void sleep(long howLong, int nanos) throws InterruptedException
InterruptedException
public static final void yield()
public boolean isInterrupted()
public static boolean interrupted()
public void start()
public final void stop(Throwable o)
public final void stop()
public final void suspend()
public final boolean isAlive()
public final void resume()
public final void join() throws InterruptedException
InterruptedException
- if the current Thread is interrupted while
waiting for this Thread to die.public final void join(long millis) throws InterruptedException
millis
- the number of milliseconds to wait.InterruptedException
- if the current Thread is interrupted while
waiting for this Thread to die.public final void join(long millis, int nanos) throws InterruptedException
millis
- the number of milliseconds to wait.nanos
- the number of nanoseconds to wait.InterruptedException
- if the current Thread is interrupted while
waiting for this Thread to die.public final void setDaemon(boolean on)
public final boolean isDaemon()
public ClassLoader getContextClassLoader()
public void setContextClassLoader(ClassLoader loader)