edu.utk.cs.icl.rest.util
Class ThreadPool
java.lang.Object
edu.utk.cs.icl.rest.util.ThreadPool
- public class ThreadPool
- extends Object
Creates a pool of threads in which things are run as a thread
becomes available.
Constructor Summary |
ThreadPool(int maxThreads)
Construct a thread poll containing maxThreads threads. |
ThreadPool
public ThreadPool(int maxThreads)
- Construct a thread poll containing maxThreads threads.
- Parameters:
maxThreads
- The number of threads to create in the pool. No more than this many threads
will be running at a given time.
add
public void add(Runnable exec)
- Add a Runnable object to the queue of threads to run.
- Parameters:
exec
- The runnable object to run on an available thread.
finalize
public void finalize()
stop
public void stop()
start
public void start()