Пример #1
0
        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);
            }
        }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
         }
     }
 }
Пример #4
0
 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);
         }
     }
 }