public class ThreadPoolImpl extends java.lang.Object implements ThreadPool
Constructor and Description |
---|
ThreadPoolImpl()
Constructor.
|
ThreadPoolImpl(boolean priorityActive)
Constructor
|
ThreadPoolImpl(boolean priorityActive,
int nThreads)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addTask(AtomicTask task)
Adds a new task to the list
|
void |
cancelPool(TileListener listener)
Cancel the pool of threads and destroy the pool
|
void |
destroyPool()
Deprecated.
|
void |
emptyPool()
Cleans the input and output pool
|
java.util.LinkedList<AtomicTask> |
getInputTaskList()
Gets the list of input tasks
|
AtomicTask |
getNext()
Gets the next task in the list
|
TilePipe |
getTilePipe()
Gets the list of output tiles
|
void |
init() |
boolean |
isPoolValid()
Returns true if the pool is valid
|
public ThreadPoolImpl()
public ThreadPoolImpl(boolean priorityActive, int nThreads)
priorityActive
- true if the pool runs using priorities and false if doesn'tnThreads
- Number of threads of this poolpublic ThreadPoolImpl(boolean priorityActive)
priorityActive
- true if the pool runs using priorities and false if doesn'tpublic void init()
public void cancelPool(TileListener listener)
listener
- public void emptyPool()
listener
- public java.util.LinkedList<AtomicTask> getInputTaskList()
ThreadPool
getInputTaskList
in interface ThreadPool
public TilePipe getTilePipe()
ThreadPool
getTilePipe
in interface ThreadPool
public void destroyPool()
destroyPool
in interface ThreadPool
public boolean isPoolValid()
public void addTask(AtomicTask task)
addTask
in interface ThreadPool
task
- public AtomicTask getNext()