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. Reviewed By: hoxyq Differential Revision: D47849848 fbshipit-source-id: 8c4be40e86be128734bfa3f571fd3a1735976c7c
- Loading branch information