Remove dead SUPPORT_THREAD_ABORT code in PLINQ (#39148)
authorStephen Toub <stoub@microsoft.com>
Sun, 12 Jul 2020 03:03:25 +0000 (23:03 -0400)
committerGitHub <noreply@github.com>
Sun, 12 Jul 2020 03:03:25 +0000 (20:03 -0700)
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs
src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ExceptionAggregator.cs
src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs

index f481be0..175aeec 100644 (file)
@@ -126,13 +126,6 @@ namespace System.Linq.Parallel
                         {
                             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 @@ namespace System.Linq.Parallel
             {
                 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.
index 09c14e9..f46df11 100644 (file)
@@ -54,13 +54,6 @@ namespace System.Linq.Parallel
             {
                 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.
index 292bcbd..a2103a4 100644 (file)
@@ -40,13 +40,6 @@ namespace System.Linq.Parallel
                         }
                         elem = enumerator.Current;
                     }
-#if SUPPORT_THREAD_ABORT
-                    catch (ThreadAbortException)
-                    {
-                        // Do not wrap ThreadAbortExceptions
-                        throw;
-                    }
-#endif
                     catch (Exception ex)
                     {
                         ThrowOCEorAggregateException(ex, cancellationState);
@@ -79,13 +72,6 @@ namespace System.Linq.Parallel
                             yield break;
                         }
                     }
-#if SUPPORT_THREAD_ABORT
-                    catch (ThreadAbortException)
-                    {
-                        // Do not wrap ThreadAbortExceptions
-                        throw;
-                    }
-#endif
                     catch (Exception ex)
                     {
                         ThrowOCEorAggregateException(ex, cancellationState);
@@ -140,13 +126,6 @@ namespace System.Linq.Parallel
                     {
                         retval = f(t);
                     }
-#if SUPPORT_THREAD_ABORT
-                    catch (ThreadAbortException)
-                    {
-                        // Do not wrap ThreadAbortExceptions
-                        throw;
-                    }
-#endif
                     catch (Exception ex)
                     {
                         ThrowOCEorAggregateException(ex, cancellationState);
index 1865bad..17a378e 100644 (file)
@@ -1579,13 +1579,6 @@ namespace System.Linq
                     {
                         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 @@ namespace System.Linq
             {
                 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 @@ namespace System.Linq
                     }
                     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 @@ namespace System.Linq
             {
                 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 @@ namespace System.Linq
                         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 @@ namespace System.Linq
                     {
                         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);