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

◆ ReduceToSingleCancellationException()

static OperationCanceledException System.Threading.Tasks.Parallel.ReduceToSingleCancellationException ( ICollection exceptions,
CancellationToken cancelToken )
inlinestaticprivate

Definition at line 1421 of file Parallel.cs.

1422 {
1423 if (exceptions == null || exceptions.Count == 0)
1424 {
1425 return null;
1426 }
1427 if (!cancelToken.IsCancellationRequested)
1428 {
1429 return null;
1430 }
1431 Exception ex = null;
1432 foreach (object exception in exceptions)
1433 {
1434 Exception ex2 = (Exception)exception;
1435 if (ex == null)
1436 {
1437 ex = ex2;
1438 }
1439 if (!(ex2 is OperationCanceledException ex3) || !cancelToken.Equals(ex3.CancellationToken))
1440 {
1441 return null;
1442 }
1443 }
1444 return (OperationCanceledException)ex;
1445 }

References System.exception, and System.exceptions.

Referenced by System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException().