static
int
|
activeCount()
Returns the number of active Thread s in the running Thread 's group and its subgroups.
|
final
void
|
checkAccess()
Does nothing.
|
int
|
countStackFrames()
This method was deprecated
in API level 1.
The results of this call were never well defined. To make
things worse, it would depend on whether the Thread was
suspended or not, and suspend was deprecated too.
|
static
Thread
|
currentThread()
Returns the Thread of the caller, that is, the current Thread.
|
void
|
destroy()
This method was deprecated
in API level 1.
Not implemented.
|
static
void
|
dumpStack()
Prints to the standard error stream a text representation of the current
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 a map of all the currently live threads to their stack traces.
|
ClassLoader
|
getContextClassLoader()
Returns the context ClassLoader for this Thread.
|
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 Thread.
|
final
int
|
getPriority()
Returns the priority of the Thread.
|
StackTraceElement[]
|
getStackTrace()
|
Thread.State
|
getState()
Returns the current state of the Thread.
|
final
ThreadGroup
|
getThreadGroup()
Returns the ThreadGroup to which this Thread belongs.
|
Thread.UncaughtExceptionHandler
|
getUncaughtExceptionHandler()
Returns the thread's uncaught exception handler.
|
static
boolean
|
holdsLock(Object object)
Indicates whether the current Thread has a monitor lock on the specified
object.
|
void
|
interrupt()
Posts an interrupt request to this Thread .
|
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 was deprecated
in API level 1.
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 Thread.
|
final
void
|
setPriority(int priority)
Sets the priority of the Thread.
|
void
|
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler handler)
Sets the uncaught exception handler.
|
static
void
|
sleep(long millis, int nanos)
Causes the thread which sent this message to sleep for the given interval
of time (given in milliseconds and nanoseconds).
|
static
void
|
sleep(long time)
Causes the thread which sent this message to sleep for the given interval
of time (given in milliseconds).
|
synchronized
void
|
start()
Starts the new Thread of execution.
|
synchronized
final
void
|
stop(Throwable throwable)
This method was deprecated
in API level 1.
because stopping a thread in this manner is unsafe and can
leave your application and the VM in an unpredictable state.
|
final
void
|
stop()
This method was deprecated
in API level 1.
because stopping a thread in this manner is unsafe and can
leave your application and the VM in an unpredictable state.
|
final
void
|
suspend()
This method was deprecated
in API level 1.
May cause deadlocks.
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
Thread.
|
static
void
|
yield()
Causes the calling Thread to yield execution time to another Thread that
is ready to run.
|