-
Notifications
You must be signed in to change notification settings - Fork 6k
Added some thread asserts to the code and made ios_surface_ safe since #12775
Conversation
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_; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
git@github.com:flutter/engine.git/compare/62e58c5d9fc2...2e163b2 git log 62e58c5..2e163b2 --no-merges --oneline 2019-10-04 dnfield@google.com Revert "Build AOT and test targets, generate FARs when building Fuchsia (#12761)" (flutter/engine#12781) 2019-10-03 30870216+gaaclarke@users.noreply.github.com Enabled people to chose if SystemNavigator.pop is animated on iOS. (flutter/engine#12752) 2019-10-03 30870216+gaaclarke@users.noreply.github.com Added some thread asserts to the code and made ios_surface_ safe since (flutter/engine#12775) 2019-10-03 dnfield@google.com Build AOT and test targets, generate FARs when building Fuchsia (flutter/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 liyuqian@google.com 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
git@github.com:flutter/engine.git/compare/62e58c5d9fc2...2e163b2 git log 62e58c5..2e163b2 --no-merges --oneline 2019-10-04 dnfield@google.com Revert "Build AOT and test targets, generate FARs when building Fuchsia (flutter#12761)" (flutter/engine#12781) 2019-10-03 30870216+gaaclarke@users.noreply.github.com Enabled people to chose if SystemNavigator.pop is animated on iOS. (flutter/engine#12752) 2019-10-03 30870216+gaaclarke@users.noreply.github.com Added some thread asserts to the code and made ios_surface_ safe since (flutter/engine#12775) 2019-10-03 dnfield@google.com Build AOT and test targets, generate FARs when building Fuchsia (flutter/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 liyuqian@google.com 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
its being written and read from different threads.
Relevant issue: flutter/flutter#41798