public class ThreadPool extends Object
| Constructor and Description |
|---|
ThreadPool(int size)
Constructs a new ThreadPool instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shutdown the pool of threads
|
void |
execute(Runnable task)
Execute the Runnable instance
through a thread in this ThreadPool.
|
void |
initPool(String name)
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.public void initPool(String name)
name - Name to give each threadpublic void close()
Copyright © 2025. All Rights Reserved.