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); }
internal void Enqueue(TransferQueueItem transferQueueItem) { _transferQueue.Enqueue(transferQueueItem); }