private void Grow(int newCapacity) { T[] oldItems = Items; T[] items = new T[Math.Max(newCapacity, 31)]; Array.Copy(oldItems, 0, items, 0, oldItems.Length); Concurrency.LockFreeUpdate(ref Items, items); }
public void Clear() { Count = 0; T[] items = new T[31]; Concurrency.LockFreeUpdate(ref Items, items); //for (int i = 0, count = Count; i < count; i++) // Items [i] = null; //Count = 0; }
// *** Adding Items *** public void AddFirst(T value) { Node node = new Node(value); node.Next = Head; Concurrency.LockFreeUpdate(ref m_Head, node); if (Current == null) { Current = node; } Count++; OnInsert(value); }
public static void LogFatal(this Exception ex, string ExceptionType = "Inline") { if (!CanLog(ex)) { return; } if (ex is OperationCanceledException) { return; } while (ex.InnerException != null) { ex = ex.InnerException; } System.Diagnostics.Debug.WriteLine(ex.Message); //Manager.Fatal ("Error: {Error}, ExceptionType: {ExceptionType}, Version: {Version}, Stack: {Stack}", ex.Message, ExceptionType, ProgramVersion, Concurrency.GetStackTrace()); Manager.Fatal("Error: {0}, ExceptionType: {1}, Version: {2}, Stack: {3}", ex.Message, ExceptionType, ProgramVersion, Concurrency.GetStackTrace()); }