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

◆ CompleteBlock()

void System.Threading.Tasks.Dataflow.WriteOnceBlock< T >.CompleteBlock ( IList< Exception > exceptions)
inlineprivate

Definition at line 156 of file WriteOnceBlock.cs.

157 {
158 TargetRegistry<T>.LinkedTargetInfo firstTarget = _targetRegistry.ClearEntryPoints();
159 if (exceptions != null && exceptions.Count > 0)
160 {
161 CompletionTaskSource.TrySetException(exceptions);
162 }
164 {
165 CompletionTaskSource.TrySetCanceled();
166 }
167 else if (Interlocked.CompareExchange(ref _lazyCompletionTaskSource, Common.CompletedVoidResultTaskCompletionSource, null) != null)
168 {
169 _lazyCompletionTaskSource.TrySetResult(default(VoidResult));
170 }
171 _targetRegistry.PropagateCompletion(firstTarget);
173 if (log.IsEnabled())
174 {
175 log.DataflowBlockCompleted(this);
176 }
177 }
static readonly TaskCompletionSource< VoidResult > CompletedVoidResultTaskCompletionSource
Definition Common.cs:32
TaskCompletionSource< VoidResult > _lazyCompletionTaskSource
TaskCompletionSource< VoidResult > CompletionTaskSource
readonly DataflowBlockOptions _dataflowBlockOptions
readonly TargetRegistry< T > _targetRegistry

References System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._dataflowBlockOptions, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._lazyCompletionTaskSource, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._targetRegistry, System.Threading.Tasks.Dataflow.DataflowBlockOptions.CancellationToken, System.Threading.Interlocked.CompareExchange(), System.Threading.Tasks.Dataflow.Internal.Common.CompletedVoidResultTaskCompletionSource, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >.CompletionTaskSource, System.exceptions, System.Threading.CancellationToken.IsCancellationRequested, and System.Threading.Tasks.Dataflow.Internal.DataflowEtwProvider.Log.

Referenced by System.Threading.Tasks.Dataflow.WriteOnceBlock< T >.OfferToTargetsAndCompleteBlock().