public class ThreadPool extends Object
| Constructor and Description |
|---|
ThreadPool(int size)
Constructs a new ThreadPool instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable task)
Execute the Runnable instance
through a thread in this ThreadPool.
|
protected void |
initPool()
Initializes the pool, populating it with
n started threads.
|
public ThreadPool(int size)
size - the size of the thread pool.public void execute(Runnable task)
task - the Runnable to be executed.protected void initPool()
Copyright © 2017. All rights reserved.