anon.util
Class ThreadPool
java.lang.Object
anon.util.ThreadPool
public final class ThreadPool
- extends java.lang.Object
Constructor Summary |
ThreadPool(java.lang.String name,
int m_maxConcurrentThreads)
|
ThreadPool(java.lang.String name,
int n,
int priority)
|
Method Summary |
private void |
add(java.lang.Runnable target,
java.lang.Object lock)
|
void |
addRequest(java.lang.Runnable target)
|
void |
addRequestAndWait(java.lang.Runnable target)
|
void |
shutdown()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
objects
private java.util.Vector objects
nObjects
private int nObjects
nMaxThreads
private int nMaxThreads
cvAvailable
private CondVar cvAvailable
cvEmpty
private CondVar cvEmpty
cvFlag
private BusyFlag cvFlag
poolThreads
private ThreadPool.ThreadPoolThread[] poolThreads
terminated
private boolean terminated
ThreadPool
public ThreadPool(java.lang.String name,
int m_maxConcurrentThreads)
ThreadPool
public ThreadPool(java.lang.String name,
int n,
int priority)
shutdown
public void shutdown()
add
private void add(java.lang.Runnable target,
java.lang.Object lock)
addRequest
public void addRequest(java.lang.Runnable target)
addRequestAndWait
public void addRequestAndWait(java.lang.Runnable target)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException