Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DynamicFromMap object pool synchronization (facebook#17842)
Summary: DynamicFromMap internally uses SimplePool object to recycle dynamic prop objects. But the pool is not multi-thread safe. Currently the most used dynamic props are size props such as left, paddingVertical, marginTop and so on. These props are only accessed from the layout thread so the pool works fine. If a dynamic prop is needed in UI thread, then the two threads can access the same pool object and cause random errors. This PR make the pool object thread local to avoid synchronization. After this change there are two pool objects created in the process. Tested in official Airbnb app after updating accessibilityComponentType to be dynamic. Once this is merged, I'll send another PR to support "disabled" state in `accessibilityComponentType`. [ANDROID] [BUGFIX] [DynamicFromMap] - Fix a crash caused by dynamic props. Pull Request resolved: facebook#17842 Differential Revision: D10374238 Pulled By: hramos fbshipit-source-id: 7ebf89c5abf06bd5fb43b205348ba4dc7e19517d
- Loading branch information