예제 #1
0
        public TimerQueueNode Enqueue(ulong timeout, Thread thr)
        {
            var currentTime = Arch.NativeMethods.l4api_get_system_clock();
            var node        = new TimerQueueNode(currentTime + timeout, thr);

            var r    = list.next;
            var prev = list;

            while (r != null && r.clock < node.clock)
            {
                prev = r;
                r    = r.next;
            }

            node.next = prev.next;
            node.prev = prev;

            if (prev.next != null)
            {
                prev.next.prev = node;
            }
            prev.next = node;

            return(node);
        }
예제 #2
0
 public FutexCompletionEntry(Thread current, UserPtr uaddr, uint bitset)
     : base(current, Kind.FutexCompletionKind)
 {
     this.uaddr       = uaddr;
     this.bitset      = bitset;
     this.timeoutNode = null;
 }
예제 #3
0
 public FutexCompletionEntry(Thread current, UserPtr uaddr, uint bitset)
     : base(current, Kind.FutexCompletionKind)
 {
     this.uaddr = uaddr;
     this.bitset = bitset;
     this.timeoutNode = null;
 }
예제 #4
0
        public Task DelayFrame()
        {
            TimeSpan time = CurrentTime;

            TimerQueueNode tqn = new TimerQueueNode(time);

            TimerQueue.Enqueue(tqn, time);

            return(tqn.Task);
        }
예제 #5
0
        public Task Delay(TimeSpan delay)
        {
            TimeSpan time = CurrentTime + delay;

            TimerQueueNode tqn = new TimerQueueNode(time);

            TimerQueue.Enqueue(tqn, time);

            return(tqn.Task);
        }
예제 #6
0
        internal void Unlink()
        {
            if (prev != null)
            {
                prev.next = next;
            }

            if (next != null)
            {
                next.prev = prev;
            }

            prev = next = null;
        }
예제 #7
0
        public TimerQueueNode Enqueue(ulong timeout, Thread thr)
        {
            var currentTime = Arch.NativeMethods.l4api_get_system_clock();
            var node = new TimerQueueNode(currentTime + timeout, thr);

            var r = list.next;
            var prev = list;
            while (r != null && r.clock < node.clock)
            {
                prev = r;
                r = r.next;
            }

            node.next = prev.next;
            node.prev = prev;

            if (prev.next != null)
                prev.next.prev = node;
            prev.next = node;

            return node;
        }
예제 #8
0
 public TimerQueue()
 {
     list = TimerQueueNode.CreateSentinal();
 }
예제 #9
0
        internal void Unlink()
        {
            if (prev != null)
                prev.next = next;

            if (next != null)
                next.prev = prev;

            prev = next = null;
        }
예제 #10
0
 public TimerQueue()
 {
     list = TimerQueueNode.CreateSentinal();
 }