Exemplo n.º 1
0
 public TimerManager()
 {
     this.onWaitCallback     = new Action <object>(this.OnWaitCallback);
     this.stableTimerGroup   = new IOThreadTimer.TimerGroup();
     this.volatileTimerGroup = new IOThreadTimer.TimerGroup();
     IOThreadTimer.WaitableTimer[] waitableTimer = new IOThreadTimer.WaitableTimer[] { this.stableTimerGroup.WaitableTimer, this.volatileTimerGroup.WaitableTimer };
     this.waitableTimers = waitableTimer;
 }
Exemplo n.º 2
0
            private static void UpdateWaitableTimer(IOThreadTimer.TimerGroup timerGroup)
            {
                IOThreadTimer.WaitableTimer waitableTimer = timerGroup.WaitableTimer;
                IOThreadTimer minTimer = timerGroup.TimerQueue.MinTimer;
                long          dueTime  = waitableTimer.DueTime - minTimer.dueTime;

                if (dueTime < (long)0)
                {
                    dueTime = -dueTime;
                }
                if (dueTime > minTimer.maxSkew)
                {
                    waitableTimer.Set(minTimer.dueTime);
                }
            }
Exemplo n.º 3
0
 public TimerGroup()
 {
     this.waitableTimer = new IOThreadTimer.WaitableTimer();
     this.waitableTimer.Set(9223372036854775807L);
     this.timerQueue = new IOThreadTimer.TimerQueue();
 }