.NET C# 泛型队列
1.QueueHelper using System.Collections.Concurrent; using System.Runtime.CompilerServices; namespace WindowsFormsServer.Helper { public static class QueueHelper<T> where T : class { private static ConcurrentQueue<StrongBox<T>> _queue; public static ConcurrentQueue<StrongBox<T>> Queue { get { return _queue ?? (_queue = new ConcurrentQueue<StrongBox<T>>()); } } public static void AddQueue(T t) { if (_queue == null) _queue = new ConcurrentQueue<StrongBox<T>>(); _queue.Enqueue(new StrongBox<T>(t)); } public static T DealQueue() { if (_queue == null) _queue = new ConcurrentQueue<StrongBox<T>>(); if