Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompleteTargetIfPossible()

void System.Threading.Tasks.Dataflow.BufferBlock< T >.CompleteTargetIfPossible ( )
inlineprivate

Definition at line 340 of file BufferBlock.cs.

341 {
343 {
344 return;
345 }
347 if (_boundingState != null && _boundingState.PostponedMessages.Count > 0)
348 {
349 Task.Factory.StartNew(delegate(object state)
350 {
353 if (bufferBlock._boundingState != null)
354 {
355 Common.ReleaseAllPostponedMessages(bufferBlock, bufferBlock._boundingState.PostponedMessages, ref exceptions);
356 }
357 if (exceptions != null)
358 {
359 bufferBlock._source.AddExceptions(exceptions);
360 }
361 bufferBlock._source.Complete();
362 }, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
363 }
364 else
365 {
367 }
368 }
readonly BoundingStateWithPostponedAndTask< T > _boundingState
static TaskCreationOptions GetCreationOptionsForTask(bool isReplacementReplica=false)
Definition Common.cs:267

References System.Threading.Tasks.Dataflow.BufferBlock< T >._boundingState, System.Threading.Tasks.Dataflow.BufferBlock< T >._source, System.Threading.Tasks.Dataflow.BufferBlock< T >._targetCompletionReserved, System.Threading.Tasks.Dataflow.BufferBlock< T >._targetDecliningPermanently, System.Threading.Tasks.Dataflow.Internal.SourceCore< TOutput >.Complete(), System.Threading.Tasks.TaskScheduler.Default, System.exceptions, System.Threading.Tasks.Task< TResult >.Factory, System.Threading.Tasks.Dataflow.Internal.Common.GetCreationOptionsForTask(), System.Threading.CancellationToken.None, System.state, and System.Threading.Tasks.Dataflow.Internal.BoundingStateWithPostponedAndTask< TInput >.TaskForInputProcessing.

Referenced by System.Threading.Tasks.Dataflow.BufferBlock< T >.CompleteCore(), System.Threading.Tasks.Dataflow.BufferBlock< T >.ConsumeMessagesLoopCore(), System.Threading.Tasks.Dataflow.BufferBlock< T >.OfferMessage(), and System.Threading.Tasks.Dataflow.BufferBlock< T >.OnItemsRemoved().