|
static
int
|
activeCount()
Returns the number of active threads in the running thread's ThreadGroup
and its subgroups.
|
|
final
void
|
checkAccess()
This method is used for operations that require approval from a
SecurityManager.
|
|
int
|
countStackFrames()
This method is deprecated.
The results of this call were never well defined. To make
things worse, it would depend if the Thread was suspended or
not, and suspend was deprecated too.
|
|
static
Thread
|
currentThread()
Returns the instance of Thread that corresponds to the running Thread
which calls this method.
|
|
void
|
destroy()
This method is deprecated.
Not implemented.
|
|
static
void
|
dumpStack()
Prints a text representation of the stack for this Thread.
|
|
static
int
|
enumerate(Thread[] threads)
Copies an array with all Threads which are in the same ThreadGroup as the
receiver - and subgroups - into the array threads passed
as parameter.
|
|
static
Map<Thread, StackTraceElement[]>
|
getAllStackTraces()
Returns the stack traces of all the currently live threads and puts them into
the given map.
|
|
ClassLoader
|
getContextClassLoader()
Returns the context ClassLoader for the receiver.
|
|
static
Thread.UncaughtExceptionHandler
|
getDefaultUncaughtExceptionHandler()
Returns the default exception handler that's executed when uncaught
exception terminates a thread.
|
|
long
|
getId()
Returns the thread's identifier.
|
|
final
String
|
getName()
Returns the name of the receiver.
|
|
final
int
|
getPriority()
Returns the priority of the receiver.
|
|
StackTraceElement[]
|
getStackTrace()
Returns the current stack trace of the thread.
|
|
Thread.State
|
getState()
Returns the current state of the thread for monitoring purposes.
|
|
final
ThreadGroup
|
getThreadGroup()
Returns the ThreadGroup to which the receiver belongs
|
|
Thread.UncaughtExceptionHandler
|
getUncaughtExceptionHandler()
Returns the thread's uncaught exception handler.
|
|
static
boolean
|
holdsLock(Object object)
Returns whether the current thread has a monitor lock on the specified
object.
|
|
void
|
interrupt()
Posts an interrupt request to the receiver.
|
|
static
boolean
|
interrupted()
Returns a boolean indicating whether the current Thread (
currentThread()) has a pending interrupt request (
true) or not (false).
|
|
final
boolean
|
isAlive()
Returns true if the receiver has already been started and
still runs code (hasn't died yet).
|
|
final
boolean
|
isDaemon()
Returns a boolean indicating whether the receiver is a
daemon Thread (true) or not (false) A
daemon Thread only runs as long as there are non-daemon Threads running.
|
|
boolean
|
isInterrupted()
Returns a boolean indicating whether the receiver has a
pending interrupt request (true) or not (
false)
|
|
final
void
|
join()
Blocks the current Thread (Thread.currentThread()) until
the receiver finishes its execution and dies.
|
|
final
void
|
join(long millis, int nanos)
Blocks the current Thread (Thread.currentThread()) until
the receiver finishes its execution and dies or the specified timeout
expires, whatever happens first.
|
|
final
void
|
join(long millis)
Blocks the current Thread (Thread.currentThread()) until
the receiver finishes its execution and dies or the specified timeout
expires, whatever happens first.
|
|
final
void
|
resume()
This method is deprecated.
Used with deprecated method suspend()
|
|
void
|
run()
Calls the run() method of the Runnable object the receiver
holds.
|
|
void
|
setContextClassLoader(ClassLoader cl)
Set the context ClassLoader for the receiver.
|
|
final
void
|
setDaemon(boolean isDaemon)
Set if the receiver is a daemon Thread or not.
|
|
static
void
|
setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
Sets the default uncaught exception handler.
|
|
final
void
|
setName(String threadName)
Sets the name of the receiver.
|
|
final
void
|
setPriority(int priority)
Sets the priority of the receiver.
|
|
void
|
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
Sets the default uncaught exception handler.
|
|
static
void
|
sleep(long time, int nanos)
Causes the thread which sent this message to sleep an interval of time
(given in milliseconds).
|
|
static
void
|
sleep(long time)
Causes the thread which sent this message to sleep an interval of time
(given in milliseconds).
|
|
synchronized
void
|
start()
Starts the new Thread of execution.
|
|
final
void
|
stop()
This method is deprecated.
No replacement.
|
|
synchronized
final
void
|
stop(Throwable throwable)
This method is deprecated.
No replacement.
|
|
final
void
|
suspend()
This method is deprecated.
May cause deadlocks.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
|
static
void
|
yield()
Causes the thread which sent this message to yield execution to another
Thread that is ready to run.
|