public void EnQueue(LoggingEvent o) { using (locker.Using()) { // If the queue is full, wait for an item to be removed if (queue.Count > maxSize) { throw new ApplicationException("GUI Log queue is full."); } queue.Enqueue(o); } }
public void EnQueue(LoggingEvent o) { using (locker.Using()) { // If the queue is full, wait for an item to be removed var mode = Factory.Parallel.Mode; if (mode == ParallelMode.RealTime && queue.Count >= maxSize) { throw new ApplicationException("Logging queue was full with " + queue.Count + " items."); } queue.Enqueue(o); } }
private void MoveMemoryToQueue() { using (memoryLocker.Using()) { streamsToWrite.Enqueue(fileBlock, 0L); } if (streamsAvailable.Count == 0) { fileBlock = new FileBlock(fileHeader.blockSize); } else { using (memoryLocker.Using()) { streamsAvailable.Dequeue(out fileBlock); } } }
private void MoveMemoryToQueue() { using (memoryLocker.Using()) { streamsToWrite.Enqueue(memory, 0L); } if (streamsAvailable.Count == 0) { memory = new MemoryStream(); } else { using (memoryLocker.Using()) { streamsAvailable.Dequeue(out memory); } } }