Esempio n. 1
0
        internal static void PerformWaitCallback(object state)
        {
            int num = 0;
            _ThreadPoolWaitCallback tpWaitCallBack = null;
            int tickCount = Environment.TickCount;

Label_000A:
            tpWaitCallBack = ThreadPoolGlobals.tpQueue.DeQueue();
            if (tpWaitCallBack != null)
            {
                ThreadPool.CompleteThreadPoolRequest(ThreadPoolGlobals.tpQueue.GetQueueCount());
                PerformWaitCallbackInternal(tpWaitCallBack);
                num = Environment.TickCount - tickCount;
                if ((num <= ThreadPoolGlobals.tpQuantum) || !ThreadPool.ShouldReturnToVm())
                {
                    goto Label_000A;
                }
            }
        }
Esempio n. 2
0
        internal static bool PerformWaitCallback()
        {
            if (ThreadPoolGlobals.useNewWorkerPool)
            {
                return(ThreadPoolWorkQueue.Dispatch());
            }
            int num = 0;
            _ThreadPoolWaitCallback callback = null;
            int tickCount = Environment.TickCount;

            do
            {
                int num3 = ThreadPoolGlobals.tpQueue.DeQueue(ref callback);
                if (callback == null)
                {
                    break;
                }
                ThreadPool.CompleteThreadPoolRequest((uint)num3);
                PerformWaitCallbackInternal(callback);
                num = Environment.TickCount - tickCount;
            }while ((num <= ThreadPoolGlobals.tpQuantum) || !ThreadPool.ShouldReturnToVm());
            return(true);
        }