Reducing lock contention in module creation

Reviewed By: javache

Differential Revision: D5147499

fbshipit-source-id: b420cc67ee97fd8cf4bb390098465f968478509f
This commit is contained in:
Kathy Gray
2017-06-06 09:00:23 -07:00
committed by Facebook Github Bot
parent e55583e59f
commit 3c89bafad5
2 changed files with 91 additions and 17 deletions
@@ -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();
}
}