Skip to content

Commit

Permalink
fix: do not delay on SynchonizationContext
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed May 3, 2019
1 parent d050696 commit 25429d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/StatsStream.cs
Expand Up @@ -34,7 +34,7 @@ static StatsStream()
{
while (true)
{
await Task.Delay(1000);
await Task.Delay(1000).ConfigureAwait(false);
lock (AllBandwidth)
{
AllBandwidth.RateIn = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/TaskWhenAnyResult.cs
Expand Up @@ -41,7 +41,7 @@ public class TaskHelper
while (running.Count > 0)
{
cancel.ThrowIfCancellationRequested();
var winner = await Task.WhenAny(running);
var winner = await Task.WhenAny(running).ConfigureAwait(false);
if (!winner.IsCanceled && !winner.IsFaulted)
{
return winner.Result;
Expand Down

0 comments on commit 25429d9

Please sign in to comment.