Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed May 12, 2016
1 parent afc311d commit 6a26710
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/System.Net.Http/tests/FunctionalTests/TestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,18 @@ public static Task WhenAllCompletedOrAnyFailed(params Task[] tasks)
{
task.ContinueWith(t =>
{
if (t.IsFaulted) tcs.SetException(t.Exception.InnerExceptions);
else if (t.IsCanceled) tcs.SetCanceled();
else if (Interlocked.Decrement(ref remaining) == 0) tcs.SetResult(true);
if (t.IsFaulted)
{
tcs.SetException(t.Exception.InnerExceptions);
}
else if (t.IsCanceled)
{
tcs.SetCanceled();
}
else if (Interlocked.Decrement(ref remaining) == 0)
{
tcs.SetResult(true);
}
}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}

Expand Down

0 comments on commit 6a26710

Please sign in to comment.