|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.util.ThreadPool
public class ThreadPool
| Constructor Summary | |
|---|---|
ThreadPool()
Create a thread pool with the default number of worker threads (currently 100). |
|
ThreadPool(int size)
Create a thread pool with the specified number of worker threads. |
|
| Method Summary | |
|---|---|
void |
addWork(Runnable work)
Add work to the thread pool. |
boolean |
idle()
Check to see if the thread pool is idle (no worker threads doing useful work). |
void |
stop()
Stop the thread pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadPool()
public ThreadPool(int size)
size - thread pool size| Method Detail |
|---|
public void stop()
stop() waits until all worker threads are
idle, then interrupts each of them (after which they should all
stop because, once idle, a worker thread waits for more work),
and then returns.
public void addWork(Runnable work)
work - work to be executed by the next available worker.public boolean idle()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||