// Ami Bar
// amibar@gmail.com
using System.Threading;
namespace Amib.Threading
{
///
/// Summary description for STPStartInfo.
///
public class STPStartInfo : WIGStartInfo
{
///
/// Idle timeout in milliseconds.
/// If a thread is idle for _idleTimeout milliseconds then
/// it may quit.
///
private int _idleTimeout;
///
/// The lower limit of threads in the pool.
///
private int _minWorkerThreads;
///
/// The upper limit of threads in the pool.
///
private int _maxWorkerThreads;
///
/// The priority of the threads in the pool
///
private ThreadPriority _threadPriority;
///
/// If this field is not null then the performance counters are enabled
/// and use the string as the name of the instance.
///
private string _pcInstanceName;
private int _stackSize;
public STPStartInfo() : base()
{
_idleTimeout = SmartThreadPool.DefaultIdleTimeout;
_minWorkerThreads = SmartThreadPool.DefaultMinWorkerThreads;
_maxWorkerThreads = SmartThreadPool.DefaultMaxWorkerThreads;
_threadPriority = SmartThreadPool.DefaultThreadPriority;
_pcInstanceName = SmartThreadPool.DefaultPerformanceCounterInstanceName;
_stackSize = SmartThreadPool.DefaultStackSize;
}
public STPStartInfo(STPStartInfo stpStartInfo) : base(stpStartInfo)
{
_idleTimeout = stpStartInfo._idleTimeout;
_minWorkerThreads = stpStartInfo._minWorkerThreads;
_maxWorkerThreads = stpStartInfo._maxWorkerThreads;
_threadPriority = stpStartInfo._threadPriority;
_pcInstanceName = stpStartInfo._pcInstanceName;
_stackSize = stpStartInfo._stackSize;
}
public int IdleTimeout
{
get { return _idleTimeout; }
set { _idleTimeout = value; }
}
public int MinWorkerThreads
{
get { return _minWorkerThreads; }
set { _minWorkerThreads = value; }
}
public int MaxWorkerThreads
{
get { return _maxWorkerThreads; }
set { _maxWorkerThreads = value; }
}
public ThreadPriority ThreadPriority
{
get { return _threadPriority; }
set { _threadPriority = value; }
}
public string PerformanceCounterInstanceName
{
get { return _pcInstanceName; }
set { _pcInstanceName = value; }
}
public int StackSize
{
get { return _stackSize; }
set { _stackSize = value; }
}
}
}