// Needed for NET35 (ThreadLocal) #if !NET_4_6 using System; using LinqInternal.Threading.Needles; namespace LinqInternal.Threading { internal static class ThreadLocalHelper { private static readonly Exception _recursionGuardException; static ThreadLocalHelper() { _recursionGuardException = GetInvalidOperationException(); } public static Exception RecursionGuardException { get { return _recursionGuardException; } } private static InvalidOperationException GetInvalidOperationException() { return new InvalidOperationException("Recursion"); } } internal static class ThreadLocalHelper { private static readonly INeedle _recursionGuardNeedle = new ExceptionStructNeedle(ThreadLocalHelper.RecursionGuardException); public static INeedle RecursionGuardNeedle { get { return _recursionGuardNeedle; } } } } #endif