Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Added some thread asserts to the code and made ios_surface_ safe since#12775

Merged
gaaclarke merged 2 commits into
flutter-team-archive:masterfrom
gaaclarke:ios-thread-asserts
Oct 3, 2019
Merged

Added some thread asserts to the code and made ios_surface_ safe since#12775
gaaclarke merged 2 commits into
flutter-team-archive:masterfrom
gaaclarke:ios-thread-asserts

Conversation

@gaaclarke

@gaaclarke gaaclarke commented Oct 3, 2019

Copy link
Copy Markdown
Contributor

its being written and read from different threads.

Relevant issue: flutter/flutter#41798

its being written and read from different threads.
private:
fml::WeakPtr<FlutterViewController> owner_controller_;
std::unique_ptr<IOSSurface> ios_surface_;
std::mutex ios_surface_mutex_;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can annotate ios_surface_ with FML_GUARDED_BY so that static thread safety check can be enabled. Also, can you add a comment there saying which threads access that resource and when. Since there wont be any contention, its hard to reason about why that lock is necessary.

@gaaclarke gaaclarke Oct 3, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

I'm not so sure usage of ios_surface_ is coordinated externally, calling SetOwnerViewController rapidly could cause CreateRenderingSurface to be talking to a undefined ios_surface_ without this mutex, for example.

@chinmaygarde chinmaygarde Oct 3, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thats good to document too. But your call.

@gaaclarke
gaaclarke merged commit 362e3fe into flutter-team-archive:master Oct 3, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 4, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Oct 4, 2019
[email protected]:flutter/engine.git/compare/62e58c5d9fc2...2e163b2

git log 62e58c5..2e163b2 --no-merges --oneline
2019-10-04 [email protected] Revert "Build AOT and test targets, generate FARs when building Fuchsia (#12761)" (flutter-team-archive/engine#12781)
2019-10-03 [email protected] Enabled people to chose if SystemNavigator.pop is animated on iOS. (flutter-team-archive/engine#12752)
2019-10-03 [email protected] Added some thread asserts to the code and made ios_surface_ safe since (flutter-team-archive/engine#12775)
2019-10-03 [email protected] Build AOT and test targets, generate FARs when building Fuchsia (flutter-team-archive/engine#12761)


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 [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
[email protected]:flutter/engine.git/compare/62e58c5d9fc2...2e163b2

git log 62e58c5..2e163b2 --no-merges --oneline
2019-10-04 [email protected] Revert "Build AOT and test targets, generate FARs when building Fuchsia (flutter#12761)" (flutter-team-archive/engine#12781)
2019-10-03 [email protected] Enabled people to chose if SystemNavigator.pop is animated on iOS. (flutter-team-archive/engine#12752)
2019-10-03 [email protected] Added some thread asserts to the code and made ios_surface_ safe since (flutter-team-archive/engine#12775)
2019-10-03 [email protected] Build AOT and test targets, generate FARs when building Fuchsia (flutter-team-archive/engine#12761)


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 [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants