mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Reducing lock contention in module creation
Reviewed By: javache Differential Revision: D5147499 fbshipit-source-id: b420cc67ee97fd8cf4bb390098465f968478509f
This commit is contained in:
committed by
Facebook Github Bot
parent
e55583e59f
commit
3c89bafad5
@@ -83,7 +83,7 @@ public class NativeModuleRegistry {
|
||||
"NativeModuleRegistry_notifyJSInstanceInitialized");
|
||||
try {
|
||||
for (ModuleHolder module : mModules.values()) {
|
||||
module.initialize();
|
||||
module.markInitializable();
|
||||
}
|
||||
} finally {
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
@@ -93,7 +93,7 @@ public class NativeModuleRegistry {
|
||||
|
||||
public void onBatchComplete() {
|
||||
for (ModuleHolder moduleHolder : mBatchCompleteListenerModules) {
|
||||
if (moduleHolder.isInitialized()) {
|
||||
if (moduleHolder.hasInstance()) {
|
||||
((OnBatchCompleteListener) moduleHolder.getModule()).onBatchComplete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user