img
. . . . . .
join
public final void join()
public final void join(long milliseconds)
public final void join(long milliseconds, long nanosec)
throws InterruptedException
This waits for the thread to exit.
Reference:
Chapter 4.
Comment:
Rarely used.
stop
public final stop()
public final stop(Throwable t)
This kills the thread asynchronously.
Reference:
Chapter 4.
Comment:
It is deprecated in Java 2. Don't use it.
sleep
public static void sleep(long milliseconds)
public static void sleep(long milliseconds, long nanosec)
throws InterruptedException
This causes the current thread to go to sleep for the specified time. The precision of the wakeup is
OS dependent. A typical minimum resolution is 10 ms. (Solaris defaults to 10 ms; root can set it to
1 ms. On Digital UNIX it's a mibisecond, 1/1024 second, 0.9765 ms.)
Reference: Chapter 4.
Comment:  Fine for test programs. Probably will never use this in a real program.
destroy
public final void destroy()
This causes the thread to exit immediately, running no finally sections, and releasing no locks.
This was included in the Java spec to handle the extreme case of broken threads that ignore
stop(). It is virtually impossible to use correctly and has never been implemented.
Reference:
Chapter 4.
isAlive
public final boolean isAlive()
This returns true if the target thread is still alive.
Reference:
Chapter 4.
activeCount
public static final int activeCount()
This returns the number of currently active threads. (Sleeping and blocked threads are active.)
Reference: Chapter 4.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home