From 1a47ff8094ee414a47aebd310826906d89428a09 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 30 May 2008 12:27:06 +0000 Subject: * This is Melanie's XEngine script engine. I've not tested this real well, however, it's confirmed to compile and OpenSimulator to run successfully without this script engine active. --- ThirdParty/SmartThreadPool/STPStartInfo.cs | 99 ++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 ThirdParty/SmartThreadPool/STPStartInfo.cs (limited to 'ThirdParty/SmartThreadPool/STPStartInfo.cs') diff --git a/ThirdParty/SmartThreadPool/STPStartInfo.cs b/ThirdParty/SmartThreadPool/STPStartInfo.cs new file mode 100644 index 0000000..d181563 --- /dev/null +++ b/ThirdParty/SmartThreadPool/STPStartInfo.cs @@ -0,0 +1,99 @@ +// 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; } + } + } +} -- cgit v1.1