/// <summary> /// 添加一个产品皮缓存池队首。 /// </summary> /// <param name="product"></param> public void AddHead(TProduct product) { // 检查是否打开 if (!this.IsOpen) { throw new ApplicationException("添加产品前必须先打开缓冲池"); } if (this.Count >= this.Capacity) { throw new ApplicationException("产品缓冲池已满"); } // Enqueue lock (_productQueue.SyncRoot) { _productQueue.Insert(0, product); if (!this.DelayNotify) { _cacheSemaphore.Release(); } } }