private void StartBLOB(uint lenExpected) { m_Blob.SetSize(0); if (lenExpected > m_Blob.MaxBufferSize) { m_Blob.Realloc(lenExpected); } m_Blob.Push(UQueue.IntenalBuffer, UQueue.HeadPosition, UQueue.GetSize()); UQueue.SetSize(0); }
public void TestEmpty() { var q = new UQueue(); Assert.Throws( typeof(InvalidOperationException), delegate { q.Peek(); } ); Assert.Throws( typeof(InvalidOperationException), delegate { q.Dequeue(); } ); }
public void TestEnqueueDequeue(params object[] args) { var q = new UQueue(); for (int i = 0; i < args.Length; ++i) { q.Enqueue(args[i]); Assert.AreEqual(q.Count, i + 1); } for (int i = 0; i < args.Length; ++i) { Assert.AreEqual(args[i], q.Dequeue()); Assert.AreEqual(q.Count, args.Length - i - 1); } }
public static void DestroyUQueuePool() { #if TASKS_ENABLED CUQueue UQueue; if (m_sQueue.TryPop(out UQueue)) { UQueue.Empty(); } #else lock (m_cs) { while (m_sQueue.Count > 0) { m_sQueue.Pop().Empty(); } } #endif }