Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead SUPPORT_THREAD_ABORT code in PLINQ #39148

Merged
merged 1 commit into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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