diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs index f481be01937c6..175aeec2da7d7 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs @@ -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. @@ -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. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs index 09c14e90aec8d..f46df11ab721a 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs @@ -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. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ExceptionAggregator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ExceptionAggregator.cs index 292bcbd555673..a2103a47de927 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ExceptionAggregator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ExceptionAggregator.cs @@ -40,13 +40,6 @@ internal static IEnumerable WrapEnumerable(IEnumerable WrapQueryEnumerator( yield break; } } -#if SUPPORT_THREAD_ABORT - catch (ThreadAbortException) - { - // Do not wrap ThreadAbortExceptions - throw; - } -#endif catch (Exception ex) { ThrowOCEorAggregateException(ex, cancellationState); @@ -140,13 +126,6 @@ internal static Func WrapFunc(Func f, CancellationState cancel { retval = f(t); } -#if SUPPORT_THREAD_ABORT - catch (ThreadAbortException) - { - // Do not wrap ThreadAbortExceptions - throw; - } -#endif catch (Exception ex) { ThrowOCEorAggregateException(ex, cancellationState); diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs index 1865bad7257f9..17a378e803773 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs @@ -1579,13 +1579,6 @@ private static TAccumulate PerformSequentialAggregation( { acc = func(acc, elem); } -#if SUPPORT_THREAD_ABORT - catch (ThreadAbortException) - { - // Do not wrap ThreadAbortExceptions - throw; - } -#endif catch (Exception e) { throw new AggregateException(e); @@ -1718,13 +1711,6 @@ public static TResult Aggregate( { return resultSelector(acc); } -#if SUPPORT_THREAD_ABORT - catch (ThreadAbortException) - { - // Do not wrap ThreadAbortExceptions - throw; - } -#endif catch (Exception e) { throw new AggregateException(e); @@ -4375,13 +4361,6 @@ public static bool SequenceEqual(this ParallelQuery 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); @@ -4409,13 +4388,6 @@ private static void DisposeEnumerator(IEnumerator e, Cancellat { e.Dispose(); } -#if SUPPORT_THREAD_ABORT - catch (ThreadAbortException) - { - // Do not wrap ThreadAbortExceptions - throw; - } -#endif catch (Exception ex) { ExceptionAggregator.ThrowOCEorAggregateException(ex, cancelState); @@ -4968,13 +4940,6 @@ public static Dictionary ToDictionary( 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); @@ -5072,13 +5037,6 @@ public static Dictionary ToDictionary( { 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);