public void Add(MicroThreadCallbackNode node) { if (First == null) { First = node; } else { Last.Next = node; } Last = node; }
public bool TakeFirst(out MicroThreadCallbackNode callback) { callback = First; if (First == null) { return(false); } First = callback.Next; callback.Next = null; return(true); }
private MicroThreadCallbackNode NewCallback() { MicroThreadCallbackNode node; var pool = Scheduler.callbackNodePool; if (Scheduler.callbackNodePool.Count > 0) { var index = pool.Count - 1; node = pool[index]; pool.RemoveAt(index); } else { node = new MicroThreadCallbackNode(); } return(node); }
public bool TakeFirst(out MicroThreadCallbackNode callback) { callback = First; if (First == null) return false; First = callback.Next; callback.Next = null; return true; }
public void Add(MicroThreadCallbackNode node) { if (First == null) First = node; else Last.Next = node; Last = node; }
private MicroThreadCallbackNode NewCallback() { MicroThreadCallbackNode node; var pool = Scheduler.callbackNodePool; if (Scheduler.callbackNodePool.Count > 0) { var index = pool.Count - 1; node = pool[index]; pool.RemoveAt(index); } else { node = new MicroThreadCallbackNode(); } Callbacks.Add(node); return node; }