Example #1
0
            private void ScheduleElapsedTimers(TimerGroup timerGroup, long now)
            {
                TimerQueue timerQueue = timerGroup.TimerQueue;

                while (timerQueue.Count > 0)
                {
                    IOThreadTimer timer    = timerQueue.MinTimer;
                    long          timeDiff = timer.dueTime - now;
                    if (timeDiff <= timer.maxSkew)
                    {
                        timerQueue.DeleteMinTimer();
                        if (timer.isAsyncCallback)
                        {
                            ActionItem.Schedule(timer.asyncCallback, timer.callbackState);
                        }
                        else
                        {
                            ActionItem.Schedule(timer.callback, timer.callbackState);
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
Example #2
0
            static void ScheduleElapsedTimers(TimerGroup timerGroup, long now)
            {
                TimerQueue timerQueue = timerGroup.TimerQueue;

                while (timerQueue.Count > 0)
                {
                    IOThreadTimer timer    = timerQueue.MinTimer;
                    long          timeDiff = timer.dueTime - now;
                    if (timeDiff <= timer.maxSkew)
                    {
                        timerQueue.DeleteMinTimer();
                        IOThreadScheduler.ScheduleCallbackNoFlow(timer.callback, timer.callbackState);
                    }
                    else
                    {
                        break;
                    }
                }
            }