Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FpsDebugFrameCallback so that we properly cancel frame loop to av…
…oid race (#38671) Summary: Pull Request resolved: #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
- Loading branch information