Exemple #1
0
 internal void Pause()
 {
     lock (this)
     {
         if (this.m_appDomainTimer == null || this.m_appDomainTimer.IsInvalid)
         {
             return;
         }
         this.m_appDomainTimer.Dispose();
         this.m_appDomainTimer            = (TimerQueue.AppDomainTimerSafeHandle)null;
         this.m_isAppDomainTimerScheduled = false;
         this.m_pauseTicks = TimerQueue.TickCount;
     }
 }
Exemple #2
0
        private bool EnsureAppDomainTimerFiresBy(uint requestedDuration)
        {
            uint dueTime = Math.Min(requestedDuration, 268435455U);

            if (this.m_isAppDomainTimerScheduled)
            {
                uint num1 = (uint)(TimerQueue.TickCount - this.m_currentAppDomainTimerStartTicks);
                if (num1 >= this.m_currentAppDomainTimerDuration)
                {
                    return(true);
                }
                uint num2 = this.m_currentAppDomainTimerDuration - num1;
                if (dueTime >= num2)
                {
                    return(true);
                }
            }
            if (this.m_pauseTicks != 0)
            {
                return(true);
            }
            if (this.m_appDomainTimer == null || this.m_appDomainTimer.IsInvalid)
            {
                this.m_appDomainTimer = TimerQueue.CreateAppDomainTimer(dueTime);
                if (this.m_appDomainTimer.IsInvalid)
                {
                    return(false);
                }
                this.m_isAppDomainTimerScheduled       = true;
                this.m_currentAppDomainTimerStartTicks = TimerQueue.TickCount;
                this.m_currentAppDomainTimerDuration   = dueTime;
                return(true);
            }
            if (!TimerQueue.ChangeAppDomainTimer(this.m_appDomainTimer, dueTime))
            {
                return(false);
            }
            this.m_isAppDomainTimerScheduled       = true;
            this.m_currentAppDomainTimerStartTicks = TimerQueue.TickCount;
            this.m_currentAppDomainTimerDuration   = dueTime;
            return(true);
        }
Exemple #3
0
 internal static extern bool ChangeAppDomainTimer(TimerQueue.AppDomainTimerSafeHandle handle, uint dueTime);