Пример #1
0
        public STPStartInfo()
        {
            _performanceCounterInstanceName = SmartThreadPool.DefaultPerformanceCounterInstanceName;
#if !(WINDOWS_PHONE)
            _threadPriority = SmartThreadPool.DefaultThreadPriority;
#endif
            _maxWorkerThreads = SmartThreadPool.DefaultMaxWorkerThreads;
            _idleTimeout      = SmartThreadPool.DefaultIdleTimeout;
            _minWorkerThreads = SmartThreadPool.DefaultMinWorkerThreads;
        }
        private void CheckSinglePriority(ThreadPriority threadPriority)
        {
            STPStartInfo stpStartInfo = new STPStartInfo();

            stpStartInfo.ThreadPriority = threadPriority;

            SmartThreadPool stp = new SmartThreadPool(stpStartInfo);

            IWorkItemResult wir = stp.QueueWorkItem(new WorkItemCallback(GetThreadPriority));
            ThreadPriority  currentThreadPriority = (ThreadPriority)wir.GetResult();

            Assert.AreEqual(threadPriority, currentThreadPriority);
        }
Пример #3
0
        public STPStartInfo(STPStartInfo stpStartInfo)
            : base(stpStartInfo)
        {
            _idleTimeout      = stpStartInfo.IdleTimeout;
            _minWorkerThreads = stpStartInfo.MinWorkerThreads;
            _maxWorkerThreads = stpStartInfo.MaxWorkerThreads;
#if !(WINDOWS_PHONE)
            _threadPriority = stpStartInfo.ThreadPriority;
#endif
            _performanceCounterInstanceName = stpStartInfo.PerformanceCounterInstanceName;
            _enableLocalPerformanceCounters = stpStartInfo._enableLocalPerformanceCounters;
            _threadPoolName       = stpStartInfo._threadPoolName;
            _areThreadsBackground = stpStartInfo.AreThreadsBackground;
#if !(_SILVERLIGHT) && !(WINDOWS_PHONE) && !(_WINDOWS_CE)
            _apartmentState = stpStartInfo._apartmentState;
#endif
        }