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); }
public FutexCompletionEntry(Thread current, UserPtr uaddr, uint bitset) : base(current, Kind.FutexCompletionKind) { this.uaddr = uaddr; this.bitset = bitset; this.timeoutNode = null; }
public Task DelayFrame() { TimeSpan time = CurrentTime; TimerQueueNode tqn = new TimerQueueNode(time); TimerQueue.Enqueue(tqn, time); return(tqn.Task); }
public Task Delay(TimeSpan delay) { TimeSpan time = CurrentTime + delay; TimerQueueNode tqn = new TimerQueueNode(time); TimerQueue.Enqueue(tqn, time); return(tqn.Task); }
internal void Unlink() { if (prev != null) { prev.next = next; } if (next != null) { next.prev = prev; } prev = next = null; }
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; }
public TimerQueue() { list = TimerQueueNode.CreateSentinal(); }
internal void Unlink() { if (prev != null) prev.next = next; if (next != null) next.prev = prev; prev = next = null; }