// Add a Magazine to the queue public void Enqueue(Magazine nMag) { lock (_lock) // Lock for thread safety { MagQueueNode newNode = new MagQueueNode(nMag); if (_head == null) { _count = 0; // Reset count, head was null _head = newNode; _tail = newNode; } else { _count++; // Increment _tail.Next = newNode; _tail = newNode; } } }
public MagQueueNode(Magazine nMag) { _mag = nMag; }