Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition in EventDispatcher
Summary: `mRCTEventEmitter` is used by 2 different threads. It's assigned on the UI thread and it's accessed on the JavaScript thread. Currently, it can be the case that the UI thread assigns `mRCTEventEmitter` and later the JS thread accesses it but still sees null. This change fixes the issue by marking the `mRCTEventEmitter` variable as `volatile` to ensure that both threads see the same value for `mRCTEventEmitter`. **Test plan (required)** This change is currently used in my team's app. We're no longer seeing a crash in `EventDispatcher`. Adam Comella Microsoft Corp. Closes #9655 Differential Revision: D3790888 Pulled By: andreicoman11 fbshipit-source-id: 68cdbc74faffb36dc2bca8ad3d4a78929badbe9c
- Loading branch information