public void Reset() { if (CurrentNode != null) { CurrentNode.EnumeratorRelease(); } CurrentNode = rootList.LinkNode; CurrentNode.EnumeratorHold(); TimeoutClock.Reset(); TimeoutClock.Start(); }
private bool TryMove(Predicate <T> Predicate = null, bool Remove = false) { lock (rootList.mutex) { var StartNode = CurrentNode; //CurrentNode.Next should never be null while (!CurrentNode.Next.Equals(rootList.LinkNode)) { CurrentNode = CurrentNode.Next; if (Predicate?.Invoke(CurrentNode.Item) ?? true) { StartNode.EnumeratorRelease(); CurrentNode.EnumeratorHold(); if (Remove) { CurrentNode.Remove(); } return(true); } } } return(false); }