Skip to content

Commit

Permalink
end YarnTask.WaitUntil if CancellationToken is cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
dogboydog committed Jan 16, 2025
1 parent 0320e69 commit 8134c8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fixed an issue where functions would not be registered with the VM until after the first call to `CommandDispatcher`.
- `YarnProjectImporter.GenerateStringsTable` is now public.
- Yarn Projects now allow choosing more specific cultures (for example 'pt-BR' and 'en-AU' rather than simply 'pt' and 'en') as their base language.
- Fixed an issue where the System.Threading.Task implementation of YarnTask.WaitUntil did not return early when the CancellationToken was cancelled ([@dogboydog])

### Removed

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Async/YarnTask/YarnTask.Task.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static partial YarnTask Delay(TimeSpan timeSpan, CancellationToken token)

public static partial async YarnTask WaitUntil(System.Func<bool> predicate, System.Threading.CancellationToken token)
{
while (predicate() == false)
while (!token.IsCancellationRequested && predicate() == false)
{
await Task.Yield();
}
Expand Down

0 comments on commit 8134c8d

Please sign in to comment.