Beispiel #1
0
 private void QueueAction(IQueuedAction action)
 {
     using (m_eventQueueLock.AcquireReadLock())
     {
         // Event queue is not disposed yet, so we can safely use it.
         if (!m_eventQueueDisposed)
         {
             m_pendingEvents.Add(action);
         }
         else
         {
             // Event writer's stream is disposed at this point, so this event can't be logged.
             // We can only return writer to its pool here.
             action.Dispose();
         }
     }
 }
Beispiel #2
0
 private void QueueAction(IQueuedAction action)
 {
     using (m_eventQueueLock.AcquireReadLock())
     {
         // Event queue is not disposed yet, so we can safely use it.
         if (!m_eventQueueDisposed)
         {
             m_pendingEvents.Enqueue(action);
             // Signal that an event is avaliable for consumption
             m_eventsAvailable.Set();
         }
         else
         {
             // Event writer's stream is disposed at this point, so this event can't be logged.
             // We can only return writer to its pool here.
             action.Dispose();
         }
     }
 }