-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Fix FpsDebugFrameCallback so that we properly cancel frame loop to avoid race #38671
Conversation
This pull request was exported from Phabricator. Differential Revision: D47849848 |
…oid race (facebook#38671) Summary: Pull Request resolved: facebook#38671 Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Differential Revision: D47849848 fbshipit-source-id: cd87d418ad4115aac7d7905e6cb8dda39939bcc0
e2d385e
to
e5e01ee
Compare
This pull request was exported from Phabricator. Differential Revision: D47849848 |
Base commit: eb5e7b2 |
This pull request was exported from Phabricator. Differential Revision: D47849848 |
e5e01ee
to
fed3f70
Compare
…oid race (facebook#38671) Summary: Pull Request resolved: facebook#38671 Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Reviewed By: hoxyq Differential Revision: D47849848 fbshipit-source-id: 0509ffef38a21000994fbdf6325acc72bddb592f
…oid race (facebook#38671) Summary: Pull Request resolved: facebook#38671 Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Reviewed By: hoxyq Differential Revision: D47849848 fbshipit-source-id: 6dfa403e493df6a50bfb07dbb1469843aaf05f6e
fed3f70
to
3b193c9
Compare
This pull request was exported from Phabricator. Differential Revision: D47849848 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D47849848 |
3b193c9
to
d50b7ac
Compare
…oid race (facebook#38671) Summary: Pull Request resolved: facebook#38671 Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Reviewed By: hoxyq Differential Revision: D47849848 fbshipit-source-id: 2ce2e87470f690f51e852493c27cd6fe1d6bf874
This pull request was exported from Phabricator. Differential Revision: D47849848 |
…oid race (facebook#38671) Summary: Pull Request resolved: facebook#38671 Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Reviewed By: hoxyq Differential Revision: D47849848 fbshipit-source-id: 5523c7a4499d48abbe3f80e2cfc1ebed00b07f93
d50b7ac
to
1d9180d
Compare
This pull request was exported from Phabricator. Differential Revision: D47849848 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D47849848 |
…oid race (facebook#38671) Summary: Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Reviewed By: hoxyq Differential Revision: D47849848
1d9180d
to
0f1b23f
Compare
…oid race (facebook#38671) Summary: Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the `mShouldStop` flag, causing the old frame loop continues to run unexpectedly. The fix here guarantees `stop` would queue logic that removes the frame loop callback, and a later `start` would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync. Changelog: [Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback. Reviewed By: hoxyq Differential Revision: D47849848
This pull request was exported from Phabricator. Differential Revision: D47849848 |
0f1b23f
to
d38b35a
Compare
This pull request was successfully merged by Xin Chen in a63b443. When will my fix make it into a release? | Upcoming Releases |
Summary:
Fix a race condition when we unmount and mount a view using FpsView too frequently. In this case, the frame loop callback didn't get a chance to unset the
mShouldStop
flag, causing the old frame loop continues to run unexpectedly.The fix here guarantees
stop
would queue logic that removes the frame loop callback, and a laterstart
would queue logic that attaches a new frame loop callback. Since both of them happens on UI thread, they are in sync.Changelog:
[Android][Fixed] - Fix a race with FpsView on using FpsDebugFrameCallback.
Differential Revision: D47849848