1 write to _nonGreedyState
System.Threading.Tasks.Dataflow (1)
Blocks\BatchBlock.cs (1)
322if (!_dataflowBlockOptions.Greedy || boundingEnabled) _nonGreedyState = new NonGreedyState(batchSize);
49 references to _nonGreedyState
System.Threading.Tasks.Dataflow (49)
Blocks\BatchBlock.cs (49)
337if (_nonGreedyState == null) 343_nonGreedyState.AcceptFewerThanBatchSize = true; 376(_boundingState.CountIsLessThanBound && _nonGreedyState!.PostponedMessages.Count == 0 && _nonGreedyState.TaskForInputProcessing == null))) 409Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 412_nonGreedyState.PostponedMessages.Push(source, messageHeader); 461Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 463_nonGreedyState.TaskForInputProcessing = null; 507bool currentlyProcessing = _nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null; 531if (targetCore._nonGreedyState != null) 535targetCore._nonGreedyState.PostponedMessages, 569bool currentlyProcessing = _nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null; 580if (_nonGreedyState != null) 583if (_nonGreedyState.AcceptFewerThanBatchSize && _messages.Count > 0) 592if (_nonGreedyState.AcceptFewerThanBatchSize && _nonGreedyState.PostponedMessages.Count > 0 && boundedCapacityAvailable > 0) 602if (_nonGreedyState.PostponedMessages.Count > 0 && boundedCapacityAvailable > 0) return true; 607if (_nonGreedyState.PostponedMessages.Count >= neededMessageCountToCompleteBatch && 622Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 641_nonGreedyState!.TaskForInputProcessing = new Task(static thisBatchTarget => ((BatchBlockTargetCore)thisBatchTarget!).ProcessMessagesLoopCore(), this, 648_owningBatch, _nonGreedyState.TaskForInputProcessing, DataflowEtwProvider.TaskLaunchedReason.ProcessingInputMessages, 649_messages.Count + _nonGreedyState.PostponedMessages.Count); 653Exception? exception = Common.StartTaskSafe(_nonGreedyState.TaskForInputProcessing, _dataflowBlockOptions.TaskScheduler); 666Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 679bool triggered = Volatile.Read(ref _nonGreedyState.AcceptFewerThanBatchSize); 696if (madeProgress || triggered) _nonGreedyState.AcceptFewerThanBatchSize = false; 711_nonGreedyState.TaskForInputProcessing = null; 756Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 760QueuedMap<ISourceBlock<T>, DataflowMessageHeader> postponed = _nonGreedyState.PostponedMessages; 761KeyValuePair<ISourceBlock<T>, DataflowMessageHeader>[] postponedTemp = _nonGreedyState.PostponedMessagesTemp; 762List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 873Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 878QueuedMap<ISourceBlock<T>, DataflowMessageHeader> postponed = _nonGreedyState.PostponedMessages; 879KeyValuePair<ISourceBlock<T>, DataflowMessageHeader>[] postponedTemp = _nonGreedyState.PostponedMessagesTemp; 880List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 982Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 983Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 987List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 1032Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1033Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1039List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 1086Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1087Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1091List<KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>> reserved = _nonGreedyState.ReservedSourcesTemp; 1182public Task? TaskForInputProcessing { get { return _target._nonGreedyState?.TaskForInputProcessing; } } 1184public QueuedMap<ISourceBlock<T>, DataflowMessageHeader>? PostponedMessages { get { return _target._nonGreedyState?.PostponedMessages; } }