Method |
Description |
static int activeCount() |
Returns the number of active threads in the current thread's thread group. |
void checkAccess() |
Determines if the currently running thread has permission to modify this thread. |
static int enumerate(Thread[] tarray) |
Copies into the specified array every active thread in the current thread's thread group and its subgroups. |
long getId() |
Returns the identifier of this Thread. |
String getName() |
Returns this thread's name. |
int getPriority() |
Returns thread's priority. |
Thread.State getState() |
Returns the state of this thread. |
ThreadGroup getThreadGroup() |
Returns the thread group to which this thread belongs. |
static boolean holdsLock(Object obj) |
Returns true if and only if the current thread holds the monitor lock on the specified object. |
void interrupt() |
interrupts this thread. |
static boolean interrupted() |
Tests whether the current thread has been interrupted. |
boolean isAlive() |
.Tests if this thread is alive. |
boolean isDaemon() |
Tests if current thread is a daemon thread. |
boolean isInterrupted() |
Tests whether current thread has been interrupted. |
void join() |
Waits for current thread to die. |
void join(long millis) |
Waits at most millis milliseconds for this thread to die. |
void setDaemon(boolean on) |
Marks current thread as either a daemon thread or a user thread. |
void setName(String name) |
Changes the name of the current thread to be equal to the argument name. |
void setPriority(int newPriority) |
Changes the priority of this thread. |
static void sleep(long millis) |
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds, subject to the precision and accuracy of system timers and schedulers. |
String toString() |
Returns a string representation of current thread, including the thread's name, priority, and thread group. |
static void yield() |
This method causes the currently executing thread object to temporarily pause and allow other threads to execute. |