Skip to content

Commit

Permalink
fixed PauseTokenTest.TestResumeWithoutPause
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Sep 20, 2024
1 parent 982650a commit 6ddbfe2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Downloader.Test/UnitTests/PauseTokenTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Downloader.Test.UnitTests;
public class PauseTokenTest
{
private readonly PauseTokenSource _pauseTokenSource = new();
private int _actualPauseCount;
private volatile int _actualPauseCount;

[Fact]
public async Task TestPauseTaskWithPauseToken()
Expand Down Expand Up @@ -61,7 +61,7 @@ private async Task IncreaseAsync(PauseToken pause, CancellationToken cancel)
while (cancel.IsCancellationRequested == false)
{
await pause.WaitWhilePausedAsync();
_actualPauseCount++;
Interlocked.Increment(ref _actualPauseCount);
await Task.Yield();
}
}
Expand Down

0 comments on commit 6ddbfe2

Please sign in to comment.