File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ namespace CodeJam.Targeting
55 /// <summary>Extended <see cref="MethodImplOptions"/></summary>
66 internal static class MethodImplOptionsEx
77 {
8- /// <summary>MethodImplOptions.AggressiveInlining or explicit value if not supported by target platform to allow inlining when running on higher framework</summary>
8+ /// <summary>MethodImplOptions.AggressiveInlining or explicit value if not supported by target platform to allow inlining when running on higher framework. </summary>
99#if NET45_OR_GREATER || TARGETS_NETSTANDARD || TARGETS_NETCOREAPP
1010 public const MethodImplOptions AggressiveInlining = MethodImplOptions . AggressiveInlining ;
1111#else
Original file line number Diff line number Diff line change 1+ using System . Threading . Tasks ;
2+
3+ namespace CodeJam . Targeting
4+ {
5+ /// <summary>Extended <see cref="TaskCreationOptions"/></summary>
6+ internal static class TaskCreationOptionsEx
7+ {
8+ /// <summary>TaskCreationOptions.RunContinuationsAsynchronously or explicit value if not supported by target platform.</summary>
9+ #if NET46_OR_GREATER || TARGETS_NETSTANDARD || TARGETS_NETCOREAPP
10+ public const TaskCreationOptions RunContinuationsAsynchronously = TaskCreationOptions . RunContinuationsAsynchronously ;
11+ #else
12+ public const TaskCreationOptions RunContinuationsAsynchronously = ( TaskCreationOptions ) 64 ;
13+ #endif
14+ }
15+ }
Original file line number Diff line number Diff line change 22using System . Threading ;
33using System . Threading . Tasks ;
44
5+ using CodeJam . Targeting ;
6+
57using JetBrains . Annotations ;
68
79#if NET45_OR_GREATER || TARGETS_NETSTANDARD || TARGETS_NETCOREAPP
@@ -121,17 +123,17 @@ public static async Task WaitForCancellationAsync(this CancellationToken cancell
121123 }
122124
123125 /// <summary>
124- /// Creates safe for await <see cref="TaskCompletionSource{TResult}"/> with <see cref="TaskCreationOptions .RunContinuationsAsynchronously"/> mode.
126+ /// Creates safe for await <see cref="TaskCompletionSource{TResult}"/> with <see cref="TaskCreationOptionsEx .RunContinuationsAsynchronously"/> mode.
125127 /// See https://devblogs.microsoft.com/premier-developer/the-danger-of-taskcompletionsourcet-class/ for explanation.
126128 /// </summary>
127129 public static TaskCompletionSource < T > CreateAsyncTaskSource < T > ( ) =>
128- new TaskCompletionSource < T > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
130+ new TaskCompletionSource < T > ( TaskCreationOptionsEx . RunContinuationsAsynchronously ) ;
129131
130132 /// <summary>
131- /// Creates safe for await <see cref="TaskCompletionSource{TResult}"/> with <see cref="TaskCreationOptions .RunContinuationsAsynchronously"/> mode.
133+ /// Creates safe for await <see cref="TaskCompletionSource{TResult}"/> with <see cref="TaskCreationOptionsEx .RunContinuationsAsynchronously"/> mode.
132134 /// See https://devblogs.microsoft.com/premier-developer/the-danger-of-taskcompletionsourcet-class/ for explanation.
133135 /// </summary>
134136 public static TaskCompletionSource < T > CreateAsyncTaskSource < T > ( TaskCreationOptions creationOptions ) =>
135- new TaskCompletionSource < T > ( creationOptions | TaskCreationOptions . RunContinuationsAsynchronously ) ;
137+ new TaskCompletionSource < T > ( creationOptions | TaskCreationOptionsEx . RunContinuationsAsynchronously ) ;
136138 }
137139}
You can’t perform that action at this time.
0 commit comments