java.lang.Thread (JDK 1.0)
This class encapsulates all the information about a single thread of control running on the Java interpreter. To create a thread, you must pass a Runnable object (i.e., an object that implements the Runnable interface by defining a run() method) to the Thread constructor, or you must subclass Thread so that it defines its own run() method.
The run() method of the Thread or of the specified Runnable object is the "body" of the thread. It begins executing when the start() method of the Thread object is called. The thread runs until the run() method returns or until the stop() method of its Thread object is called. The static methods of this class operate on the currently running thread. The instance methods may be called from one thread to operate on a different thread.
start() starts a thread running. stop() stops it by throwing a ThreadDeath error. suspend() temporarily halts a thread. resume() allows it to resume. sleep() makes the current thread stop for a specified amount of time. yield() makes the current thread give up control to any other threads of equal priority that are waiting to run. join() waits for a thread to die. interrupt() wakes up a waiting or sleeping thread (with an InterruptedException) or sets an "interrupted" flag on a non-sleeping thread. A thread can test its own "interrupted" flag with interrupted() or can test the flag of another thread with isInterrupted(). The Object wait() method makes the current thread block until the object's notify() method is called by another thread.
public classThreadextends Object implements Runnable { //Public ConstructorspublicThread(); publicThread(Runnabletarget); publicThread(ThreadGroupgroup, Runnabletarget); publicThread(Stringname); publicThread(ThreadGroupgroup, Stringname); publicThread(Runnabletarget, Stringname); publicThread(ThreadGroupgroup, Runnabletarget, Stringname); //Constantspublic static final intMAX_PRIORITY; public static final intMIN_PRIORITY; public static final intNORM_PRIORITY; //Class Methodspublic static intactiveCount(); public static native ThreadcurrentThread(); public static voiddumpStack(); public static intenumerate(Thread[]tarray); public static booleaninterrupted(); public static native voidsleep(longmillis) throws InterruptedException; public static voidsleep(longmillis, intnanos) throws InterruptedException; public static native voidyield(); //Public Instance Methodspublic voidcheckAccess(); public native intcountStackFrames(); public voiddestroy(); public final StringgetName(); public final intgetPriority(); public final ThreadGroupgetThreadGroup(); public voidinterrupt(); public final native booleanisAlive(); public final booleanisDaemon(); public booleanisInterrupted(); public final synchronized voidjoin(longmillis) throws InterruptedException; public final synchronized voidjoin(longmillis, intnanos) throws InterruptedException; public final voidjoin() throws InterruptedException; public final voidresume(); public voidrun(); //From Runnablepublic final voidsetDaemon(booleanon); public final voidsetName(Stringname); public final voidsetPriority(intnewPriority); public synchronized native voidstart(); public final voidstop(); public final synchronized voidstop(Throwableo); public final voidsuspend(); public StringtoString(); //Overrides Object}
Passed To:
SecurityManager.checkAccess(), Thread.enumerate(), ThreadGroup.enumerate(), ThreadGroup.uncaughtException()
Returned By:
Thread.currentThread()