Internal representation of an individual timer.

Наследование: System.Threading.Timer
Пример #1
0
            internal override TimerThread.Timer CreateTimer(TimerThread.Callback callback, object context)
            {
                TimerThread.TimerNode node = new TimerThread.TimerNode(callback, context, base.Duration, this.m_Timers);
                bool flag = false;

                lock (this.m_Timers)
                {
                    if (this.m_Timers.Next == this.m_Timers)
                    {
                        if (this.m_ThisHandle == IntPtr.Zero)
                        {
                            this.m_ThisHandle = (IntPtr)GCHandle.Alloc(this);
                        }
                        flag = true;
                    }
                    node.Next = this.m_Timers;
                    node.Prev = this.m_Timers.Prev;
                    this.m_Timers.Prev.Next = node;
                    this.m_Timers.Prev      = node;
                }
                if (flag)
                {
                    TimerThread.Prod();
                }
                return(node);
            }
 internal override TimerThread.Timer CreateTimer(TimerThread.Callback callback, object context)
 {
     TimerThread.TimerNode node = new TimerThread.TimerNode(callback, context, base.Duration, this.m_Timers);
     bool flag = false;
     lock (this.m_Timers)
     {
         if (this.m_Timers.Next == this.m_Timers)
         {
             if (this.m_ThisHandle == IntPtr.Zero)
             {
                 this.m_ThisHandle = (IntPtr) GCHandle.Alloc(this);
             }
             flag = true;
         }
         node.Next = this.m_Timers;
         node.Prev = this.m_Timers.Prev;
         this.m_Timers.Prev.Next = node;
         this.m_Timers.Prev = node;
     }
     if (flag)
     {
         TimerThread.Prod();
     }
     return node;
 }
 internal TimerQueue(int durationMilliseconds) : base(durationMilliseconds)
 {
     this.m_Timers = new TimerThread.TimerNode();
     this.m_Timers.Next = this.m_Timers;
     this.m_Timers.Prev = this.m_Timers;
 }
Пример #4
0
 internal TimerQueue(int durationMilliseconds) : base(durationMilliseconds)
 {
     this.m_Timers      = new TimerThread.TimerNode();
     this.m_Timers.Next = this.m_Timers;
     this.m_Timers.Prev = this.m_Timers;
 }