// ctor
        internal RequestQueue(int minExternFreeThreads, int minLocalFreeThreads, int queueLimit, TimeSpan clientConnectedTime)
        {
            _minExternFreeThreads = minExternFreeThreads;
            _minLocalFreeThreads  = minLocalFreeThreads;
            _queueLimit           = queueLimit;
            _clientConnectedTime  = clientConnectedTime;

            _workItemCallback = new WaitCallback(this.WorkItemCallback);

            _timer = new Timer(new TimerCallback(this.TimerCompletionCallback), null, _timerPeriod, _timerPeriod);
            _iis6  = HostingEnvironment.IsUnderIIS6Process;

            // set the minimum number of requests that must be executing in order to detect a deadlock
            int maxWorkerThreads, maxIoThreads;

            ThreadPool.GetMaxThreads(out maxWorkerThreads, out maxIoThreads);
            UnsafeNativeMethods.SetMinRequestsExecutingToDetectDeadlock(maxWorkerThreads - minExternFreeThreads);
        }
        internal RequestQueue(int minExternFreeThreads, int minLocalFreeThreads, int queueLimit, TimeSpan clientConnectedTime)
        {
            int num;
            int num2;

            this._localQueue           = new Queue();
            this._externQueue          = new Queue();
            this._timerPeriod          = new TimeSpan(0, 0, 10);
            this._minExternFreeThreads = minExternFreeThreads;
            this._minLocalFreeThreads  = minLocalFreeThreads;
            this._queueLimit           = queueLimit;
            this._clientConnectedTime  = clientConnectedTime;
            this._workItemCallback     = new WaitCallback(this.WorkItemCallback);
            this._timer = new Timer(new TimerCallback(this.TimerCompletionCallback), null, this._timerPeriod, this._timerPeriod);
            this._iis6  = HostingEnvironment.IsUnderIIS6Process;
            ThreadPool.GetMaxThreads(out num, out num2);
            UnsafeNativeMethods.SetMinRequestsExecutingToDetectDeadlock(num - minExternFreeThreads);
        }