net.wimpi.modbus.util
Class ThreadPool

java.lang.Object
  extended by 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.
 
Field Summary
private  int m_Size
           
private  LinkedQueue m_TaskPool
           
 
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
 

Field Detail

m_TaskPool

private LinkedQueue m_TaskPool

m_Size

private int m_Size
Constructor Detail

ThreadPool

public ThreadPool(int size)
Constructs a new ThreadPool instance.

Parameters:
size - the size of the thread pool.
Method Detail

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.