Skip to content

Conversation

EgorRudakov2
Copy link
Contributor

What does the pull request do?

Makes all Task.ContinueWith calls in rendering-related code to use TaskScheduler.Default.

What is the current behavior?

When Compositor.CommitCore() is called indirectly from task (for example viaDispatcher.Invoke or Dispatcher.PushFrame methods) started with TaskScheduler, that scheduler will be used byContinueWith to continuation scheduling.

See #19710 for reproducible sample

What is the updated/expected behavior with this PR?

All continuations in rendering-related code now use TaskScheduler.Default.

Fixed issues

Fixes #19710

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0057436-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jul 1, 2025

  • All contributors have signed the CLA.

@maxkatz6 maxkatz6 requested a review from kekekeks July 2, 2025 01:30
@EgorRudakov2
Copy link
Contributor Author

@cla-avalonia agree

@kekekeks kekekeks added this pull request to the merge queue Jul 3, 2025
@kekekeks kekekeks added the backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch label Jul 3, 2025
Merged via the queue into AvaloniaUI:master with commit fb83c11 Jul 3, 2025
10 of 11 checks passed
@MrJul MrJul added the bug label Jul 3, 2025
MrJul pushed a commit that referenced this pull request Aug 5, 2025
* Prevent ContinueWith from scheduling some of rendering callbacks into UI thread. (#19170 fix)

* Add _pendingBatch null check
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants