예제 #1
0
        //-------------------------------------------------------------------------
        public void destroy()
        {
            if (mWheel1 != null)
            {
                mWheel1.Dispose();
                mWheel1 = null;
            }

            if (mWheel2 != null)
            {
                mWheel2.Dispose();
                mWheel2 = null;
            }

            if (mWheel3 != null)
            {
                mWheel3.Dispose();
                mWheel3 = null;
            }

            if (mWheel4 != null)
            {
                mWheel4.Dispose();
                mWheel4 = null;
            }

            if (mWheel5 != null)
            {
                mWheel5.Dispose();
                mWheel5 = null;
            }
        }
예제 #2
0
 //-------------------------------------------------------------------------
 public EbTimer()
 {
     mWheel1 = new EbTimeWheel((int)MAX_WHEEL_SIZE);
     mWheel2 = new EbTimeWheel((int)MIN_WHEEL_SIZE);
     mWheel3 = new EbTimeWheel((int)MIN_WHEEL_SIZE);
     mWheel4 = new EbTimeWheel((int)MIN_WHEEL_SIZE);
     mWheel5 = new EbTimeWheel((int)MIN_WHEEL_SIZE);
 }
예제 #3
0
        //-------------------------------------------------------------------------
        // 调整时间轮上的事件
        int _cascadeTimer(EbTimeWheel timer_wheel, int wheel_index)
        {
            int index = (int)((mTimeJeffies >> (Convert.ToInt32(MAX_WHEEL) + wheel_index * Convert.ToInt32(MIN_WHEEL))) & MIN_WHEEL_MASK);

            EbDoubleLinkNode <EbTimeEvent> head, curr, next;

            head = timer_wheel.getSpokeHead(index);
            curr = head.next;

            while (curr != head)
            {
                next = curr.next;

                _delTimer(curr);
                _addTimer(curr);

                curr = next;
            }

            return(index);
        }