Exemplo n.º 1
0
        static TimerList()
        {
            //
            // Create the objects.
            //

            _lock         = new SpinLock(TIMER_LIST_LOCK_SPINS);
            timerListHead = new RawTimer(null);
            limitTimer    = new RawTimer(null);
            parker        = new StParker(1);

            //
            // Initialize the limit timer as unlinked.
            //

            limitTimer.next = limitTimer;

            //
            // Initialize the timer list as empty.
            //

            timerListHead.next = timerListHead.prev = timerListHead;

            //
            // Set the start base time e set the *delay* sentinel.
            //

            baseTime            = Environment.TickCount;
            timerListHead.delay = Int32.MaxValue;

            //
            // Create and start the timer thread.
            //

            new Thread(TimerThread).Start();
        }