Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pthread based thread local support. #49297

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

chinmaygarde
Copy link
Member

The thread_local storage class was not available pre-C++11. Even when C++11 was available, the C++ runtime in versions of iOS <= 9.0 was not capable of supporting this storage class. So we ended up using pthread directly in that case. The unique pointer support was added later. Now that the storage class has been supported on all Flutter platforms for a while, we can remove the fallback and remove a bunch of code. The ThreadLocalUniquePtr can be removed too but that can be attempted in a separate migration.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@text-exemption-reviewers" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

@chinmaygarde
Copy link
Member Author

I am not sure how the test could be related. But I'll it it just the same. This removes unnecessary code.

@jason-simmons
Copy link
Member

Looked into these test failures and found that some embedder tests were leaking platform message response handles.

Proposed fix: #49548

(I don't know why ASAN is only reporting these leaks when this PR is applied)

@chinmaygarde
Copy link
Member Author

Rebasing after the proposed fix landed.

The thread_local storage class was not available pre-C++11. Even when C++11 was
available, the C++ runtime in versions of iOS <= 9.0 was not capable of
supporting this storage class. So we ended up using pthread directly in that
case. The unique pointer support was added later. Now that the storage class
has been supported on all Flutter platforms for a while, we can remove the
fallback and remove a bunch of code. The ThreadLocalUniquePtr can be removed
too but that can be attempted in a separate migration.
@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 8, 2024
@chinmaygarde chinmaygarde added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Jan 13, 2024
@auto-submit auto-submit bot merged commit f206573 into flutter:main Jan 13, 2024
29 checks passed
@chinmaygarde chinmaygarde deleted the rm_thread_local branch January 13, 2024 21:28
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 14, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 14, 2024
…141518)

flutter/engine@a0ac66e...f206573

2024-01-13 chinmaygarde@google.com Remove pthread based thread local support. (flutter/engine#49297)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
3 participants