|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gjt.sp.util.WorkThreadPool
A pool of work threads.
WorkThread
Constructor Summary | |
WorkThreadPool(java.lang.String name,
int count)
Creates a new work thread pool with the specified number of work threads. |
Method Summary | |
void |
addProgressListener(WorkThreadProgressListener listener)
Adds a progress listener to this thread pool. |
void |
addWorkRequest(java.lang.Runnable run,
boolean inAWT)
Adds a work request to the queue. |
int |
getRequestCount()
Returns the number of pending requests. |
WorkThread |
getThread(int index)
Returns the specified thread. |
int |
getThreadCount()
Returns the number of threads in this pool. |
void |
removeProgressListener(WorkThreadProgressListener listener)
Removes a progress listener from this thread pool. |
void |
start()
Starts all the threads in this thread pool. |
void |
waitForRequests()
Waits until all requests are complete. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WorkThreadPool(java.lang.String name, int count)
name
- The thread name prefixcount
- The number of work threadsMethod Detail |
public void start()
public void addWorkRequest(java.lang.Runnable run, boolean inAWT)
run
- The runnableinAWT
- If true, will be executed in AWT thread. Otherwise,
will be executed in work threadpublic void waitForRequests()
public int getRequestCount()
public int getThreadCount()
public WorkThread getThread(int index)
index
- The index of the threadpublic void addProgressListener(WorkThreadProgressListener listener)
listener
- The listenerpublic void removeProgressListener(WorkThreadProgressListener listener)
listener
- The listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |