net.wimpi.modbus.util
Class ThreadPool
java.lang.Object
net.wimpi.modbus.util.ThreadPool
public class ThreadPool
- extends Object
Class implementing a simple thread pool.
- Version:
- 1.2 (@date@)
- Author:
- Dieter Wimberger
|
Nested Class Summary |
private class |
ThreadPool.PoolThread
Inner class implementing a thread that can be
run in a ThreadPool. |
|
Constructor Summary |
ThreadPool(int size)
Constructs a new ThreadPool instance. |
|
Method Summary |
void |
execute(Runnable task)
Execute the Runnable instance
through a thread in this ThreadPool. |
protected void |
initPool()
Initializes the pool, populating it with
n started threads. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_TaskPool
private LinkedQueue m_TaskPool
m_Size
private int m_Size
ThreadPool
public ThreadPool(int size)
- Constructs a new ThreadPool instance.
- Parameters:
size - the size of the thread pool.
execute
public void execute(Runnable task)
- Execute the Runnable instance
through a thread in this ThreadPool.
- Parameters:
task - the Runnable to be executed.
initPool
protected void initPool()
- Initializes the pool, populating it with
n started threads.
Copyright © 2012. All Rights Reserved.