Skip to content

Commit

Permalink
Remove dead SUPPORT_THREAD_ABORT code in PLINQ (#39148)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Jul 12, 2020
1 parent 0f770d5 commit 3719f3c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ internal TOutput Aggregate()
{
accumulator = _finalReduce(accumulator, enumerator.Current);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
// We need to wrap all exceptions into an aggregate.
Expand Down Expand Up @@ -166,13 +159,6 @@ internal TOutput Aggregate()
{
return _resultSelector(accumulator);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
// We need to wrap all exceptions into an aggregate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ internal TResult Aggregate()
{
tr = InternalAggregate(ref toThrow);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
// If the exception is not an aggregate, we must wrap it up and throw that instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ internal static IEnumerable<TElement> WrapEnumerable<TElement>(IEnumerable<TElem
}
elem = enumerator.Current;
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
ThrowOCEorAggregateException(ex, cancellationState);
Expand Down Expand Up @@ -79,13 +72,6 @@ internal static IEnumerable<TElement> WrapQueryEnumerator<TElement, TIgnoreKey>(
yield break;
}
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
ThrowOCEorAggregateException(ex, cancellationState);
Expand Down Expand Up @@ -140,13 +126,6 @@ internal static Func<T, U> WrapFunc<T, U>(Func<T, U> f, CancellationState cancel
{
retval = f(t);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
ThrowOCEorAggregateException(ex, cancellationState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1579,13 +1579,6 @@ private static TAccumulate PerformSequentialAggregation<TSource, TAccumulate>(
{
acc = func(acc, elem);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception e)
{
throw new AggregateException(e);
Expand Down Expand Up @@ -1718,13 +1711,6 @@ public static TResult Aggregate<TSource, TAccumulate, TResult>(
{
return resultSelector(acc);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception e)
{
throw new AggregateException(e);
Expand Down Expand Up @@ -4375,13 +4361,6 @@ public static bool SequenceEqual<TSource>(this ParallelQuery<TSource> first, Par
}
if (e2.MoveNext()) return false;
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
ExceptionAggregator.ThrowOCEorAggregateException(ex, settings.CancellationState);
Expand Down Expand Up @@ -4409,13 +4388,6 @@ private static void DisposeEnumerator<TSource>(IEnumerator<TSource> e, Cancellat
{
e.Dispose();
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
ExceptionAggregator.ThrowOCEorAggregateException(ex, cancelState);
Expand Down Expand Up @@ -4968,13 +4940,6 @@ public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(
key = keySelector(val);
result.Add(key, val);
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
throw new AggregateException(ex);
Expand Down Expand Up @@ -5072,13 +5037,6 @@ public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(
{
result.Add(keySelector(src), elementSelector(src));
}
#if SUPPORT_THREAD_ABORT
catch (ThreadAbortException)
{
// Do not wrap ThreadAbortExceptions
throw;
}
#endif
catch (Exception ex)
{
throw new AggregateException(ex);
Expand Down

0 comments on commit 3719f3c

Please sign in to comment.