mirror of
https://github.com/status-im/react-native.git
synced 2025-02-22 14:18:23 +00:00
Refactor 'induce' of events in Fabric Android
Summary: This diff refactors the exeuction of 'AsyncEventBeat.induce()' as part of the delivery of events of Fabric Android implementation. The first part of the refactor moves the exeuction of onBatchEventDispatched out of the synchronization block for mEventsToDispatchLock. This lock is accessed from the UI Thread and executing the induce inside this synchronization block will affect UI, The second part of the refactor is to ensure that the exeuction of the C++ method AsyncEventBeat.induce() always happen in the JS Thread. Reviewed By: shergin Differential Revision: D12861387 fbshipit-source-id: e1cd03467274a1c5fcd04b0ac7efdbe7169b14c3
This commit is contained in:
parent
7b04f6aeaa
commit
95b21b4828
@ -365,12 +365,12 @@ public class EventDispatcher implements LifecycleEventListener {
|
||||
event.dispatch(mReactEventEmitter);
|
||||
event.dispose();
|
||||
}
|
||||
for (BatchEventDispatchedListener listener : mPostEventDispatchListeners) {
|
||||
listener.onBatchEventDispatched();
|
||||
}
|
||||
clearEventsToDispatch();
|
||||
mEventCookieToLastEventIdx.clear();
|
||||
}
|
||||
for (BatchEventDispatchedListener listener : mPostEventDispatchListeners) {
|
||||
listener.onBatchEventDispatched();
|
||||
}
|
||||
} finally {
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user