img
. . . . .
Comment:
Deprecated in Java 1.1. See ThreadGroup.allThreadsCount().
enumerate
public static final int enumerate(Thread tarray[])
This fills tarray with as many currently active threads as fit, returning that number.
Reference:
Chapter 4.
Comment:
Deprecated in Java 1.1. See ThreadGroup.allThreads().
getName setName
public String getName()
public void setName(String name)
throws SecurityException
This gets/sets the print name for the thread.
Reference:
Chapter 4.
The Class Extensions.InterruptibleThread
This is one of the classes that we defined for this topic to provide a consistent interface for dealing
with certain problems.
exit
public void exit()
This causes the current thread to exit. It is syntactic sugar for
Thread.currentThread().stop().
Reference: Chapter 4.
Comment: We wrote this method while trying to deal with the absence of such a
function and the absence of any advice on this apparent oversight. We have
subsequently been convinced that this is the wrong way to do things and that
you should always return from the run() method (see Exiting a Thread).
The Interface java.lang.Runnable
This interface provides the building blocks for threads. You implement this interface, define a
run() method on the class, and pass an instance of it to the thread.
run
public void run()
This is the method you define that actually executes the code you want.
Reference:
Chapter 4.
Comment:
This is the only way to start anything.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home