Skip to content

Commit 7563cca

Browse files
authored
Always use TaskCreationOptions.RunContinuationsAsynchronously (#1966)
1 parent 1ae901d commit 7563cca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Microsoft.AspNetCore.Http.Connections/HttpConnectionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class HttpConnectionContext : ConnectionContext,
3434

3535
// This tcs exists so that multiple calls to DisposeAsync all wait asynchronously
3636
// on the same task
37-
private readonly TaskCompletionSource<object> _disposeTcs = new TaskCompletionSource<object>();
37+
private readonly TaskCompletionSource<object> _disposeTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
3838

3939
/// <summary>
4040
/// Creates the DefaultConnectionContext without Pipes to avoid upfront allocations.

src/Microsoft.AspNetCore.SignalR.Core/HubConnectionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class HubConnectionContext
2929
private readonly ConnectionContext _connectionContext;
3030
private readonly ILogger _logger;
3131
private readonly CancellationTokenSource _connectionAbortedTokenSource = new CancellationTokenSource();
32-
private readonly TaskCompletionSource<object> _abortCompletedTcs = new TaskCompletionSource<object>();
32+
private readonly TaskCompletionSource<object> _abortCompletedTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
3333
private readonly long _keepAliveDuration;
3434
private readonly SemaphoreSlim _writeLock = new SemaphoreSlim(1);
3535

0 commit comments

Comments
 (0)