1 write to _nonGreedyState
System.Threading.Tasks.Dataflow (1)
Blocks\BatchBlock.cs (1)
319if (!_dataflowBlockOptions.Greedy || boundingEnabled) _nonGreedyState = new NonGreedyState(batchSize);
49 references to _nonGreedyState
System.Threading.Tasks.Dataflow (49)
Blocks\BatchBlock.cs (49)
334if (_nonGreedyState == null) 340_nonGreedyState.AcceptFewerThanBatchSize = true; 373(_boundingState.CountIsLessThanBound && _nonGreedyState!.PostponedMessages.Count == 0 && _nonGreedyState.TaskForInputProcessing == null))) 406Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 409_nonGreedyState.PostponedMessages.Push(source, messageHeader); 458Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 460_nonGreedyState.TaskForInputProcessing = null; 504bool currentlyProcessing = _nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null; 528if (targetCore._nonGreedyState != null) 532targetCore._nonGreedyState.PostponedMessages, 566bool currentlyProcessing = _nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null; 577if (_nonGreedyState != null) 580if (_nonGreedyState.AcceptFewerThanBatchSize && _messages.Count > 0) 589if (_nonGreedyState.AcceptFewerThanBatchSize && _nonGreedyState.PostponedMessages.Count > 0 && boundedCapacityAvailable > 0) 599if (_nonGreedyState.PostponedMessages.Count > 0 && boundedCapacityAvailable > 0) return true; 604if (_nonGreedyState.PostponedMessages.Count >= neededMessageCountToCompleteBatch && 619Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 638_nonGreedyState!.TaskForInputProcessing = new Task(static thisBatchTarget => ((BatchBlockTargetCore)thisBatchTarget!).ProcessMessagesLoopCore(), this, 645_owningBatch, _nonGreedyState.TaskForInputProcessing, DataflowEtwProvider.TaskLaunchedReason.ProcessingInputMessages, 646_messages.Count + _nonGreedyState.PostponedMessages.Count); 650Exception? exception = Common.StartTaskSafe(_nonGreedyState.TaskForInputProcessing, _dataflowBlockOptions.TaskScheduler); 663Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 676bool triggered = Volatile.Read(ref _nonGreedyState.AcceptFewerThanBatchSize); 693if (madeProgress || triggered) _nonGreedyState.AcceptFewerThanBatchSize = false; 708_nonGreedyState.TaskForInputProcessing = null; 753Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 757QueuedMap<ISourceBlock<T>, DataflowMessageHeader> postponed = _nonGreedyState.PostponedMessages; 758KeyValuePair<ISourceBlock<T>, DataflowMessageHeader>[] postponedTemp = _nonGreedyState.PostponedMessagesTemp; 759List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 870Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 875QueuedMap<ISourceBlock<T>, DataflowMessageHeader> postponed = _nonGreedyState.PostponedMessages; 876KeyValuePair<ISourceBlock<T>, DataflowMessageHeader>[] postponedTemp = _nonGreedyState.PostponedMessagesTemp; 877List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 979Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 980Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 984List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 1029Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1030Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1036List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 1083Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1084Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1088List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 1179public Task? TaskForInputProcessing { get { return _target._nonGreedyState?.TaskForInputProcessing; } } 1181public QueuedMap<ISourceBlock<T>, DataflowMessageHeader>? PostponedMessages { get { return _target._nonGreedyState?.PostponedMessages; } }