8000 Change default Linux thread policy to merge platform and UI threads. by robert-ancell · Pull Request #176759 · flutter/flutter · GitHub
[go: up one dir, main page]

Skip to content

Conversation

robert-ancell
Copy link
Contributor

This matches the other platforms who have already done this migration (Android and iOS in 3.32, Windows and MacOS in 3.33).

Applications may opt-out of this change by setting the thread policy to unmerged with:

fl_dart_project_set_ui_thread_policy(project, FL_UI_THREAD_POLICY_RUN_ON_SEPARATE_THREAD);

in linux/runner/my_application.cc

This matches the other platforms who have already done this migration (Android and iOS in 3.32, Windows and MacOS in 3.33).

Applications may opt-out of this change by setting the thread policy to unmerged with:
```c
fl_dart_project_set_ui_thread_policy(project, FL_UI_THREAD_POLICY_RUN_ON_SEPARATE_THREAD);
```
in `linux/runner/my_application.cc`
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@robert-ancell robert-ancell requested a review from knopp October 9, 2025 03:06
@github-actions github-actions bot added engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically a: desktop Running on desktop labels Oct 9, 2025
Copy link
Contributor
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request changes the default thread policy on Linux to merge the platform and UI threads, aligning it with other platforms. The implementation in fl_engine.cc correctly uses a switch statement to handle the different thread policies. My review focuses on ensuring the change is robust and well-tested.

@mit-mit
Copy link
Member
mit-mit commented Oct 9, 2025

Thanks! We probably need an entry on https://docs.flutter.dev/release/breaking-changes similar to the 3.35 one for macOS and Windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0