Woopsa.CustomThreadPool.CustomThreadPool C# (CSharp) Method

CustomThreadPool() public method

public CustomThreadPool ( string name, int threadPoolSize = DefaultThreadPoolSize, ThreadPriority priority = ThreadPriority.Normal ) : System
name string
threadPoolSize int
priority ThreadPriority
return System
        public CustomThreadPool(string name, int threadPoolSize = DefaultThreadPoolSize, ThreadPriority priority = ThreadPriority.Normal)
        {
            if (threadPoolSize == DefaultThreadPoolSize)
            {
                int n;
                ThreadPool.GetMaxThreads(out _threadPoolSize, out n);
            }
            else
            {
                Debug.Assert(threadPoolSize > 0);
                _threadPoolSize = threadPoolSize;
            }
            _threads = new List<CustomThreadPoolThread>();
            _semaphore = new Semaphore(_threadPoolSize, _threadPoolSize);
            Priority = priority;
            Name = name;
        }