Always use TaskCreationOptions.RunContinuationsAsynchronously (#1966)

This commit is contained in:
James Newton-King 2018-04-12 18:21:20 +12:00 committed by GitHub
parent 1ae901de3d
commit 7563ccae20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Http.Connections
// This tcs exists so that multiple calls to DisposeAsync all wait asynchronously
// on the same task
private readonly TaskCompletionSource<object> _disposeTcs = new TaskCompletionSource<object>();
private readonly TaskCompletionSource<object> _disposeTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
/// <summary>
/// Creates the DefaultConnectionContext without Pipes to avoid upfront allocations.

View File

@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.SignalR
private readonly ConnectionContext _connectionContext;
private readonly ILogger _logger;
private readonly CancellationTokenSource _connectionAbortedTokenSource = new CancellationTokenSource();
private readonly TaskCompletionSource<object> _abortCompletedTcs = new TaskCompletionSource<object>();
private readonly TaskCompletionSource<object> _abortCompletedTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
private readonly long _keepAliveDuration;
private readonly SemaphoreSlim _writeLock = new SemaphoreSlim(1);