Beispiel #1
0
        internal bool TryDequeue(out TransferQueueItem transferQueueItem)
        {
            transferQueueItem = null;

            while (_transferQueue.Count > 0)
            {
                var tqi = _transferQueue.Dequeue();

                if (tqi.SelectFireContext == null ||
                    Interlocked.CompareExchange(ref tqi.SelectFireContext.Fired, tqi, null) == null)
                {
                    transferQueueItem = tqi;
                    return(true);
                }
            }

            return(false);
        }
Beispiel #2
0
 internal void Enqueue(TransferQueueItem transferQueueItem)
 {
     _transferQueue.Enqueue(transferQueueItem);
 }