public class ThreadPool
extends java.lang.Object
Constructor and Description |
---|
ThreadPool(int corePoolSize)
Creates a new ThreadPool with the given initial parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable command)
Executes the given task sometime in the future.
|
protected void |
finalize()
Invokes shutdown when this executor is no longer referenced and it has no
threads.
|
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are
executed, but no new tasks will be accepted.
|
public ThreadPool(int corePoolSize)
corePoolSize
- - the number of threads to keep in the pool, even if they
are idlepublic void execute(java.lang.Runnable command) throws java.lang.NullPointerException
command
- java.lang.NullPointerException
- if command is nullpublic void shutdown()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable