Skip to content

Commit

Permalink
Back out "Control concurrent calls into TMMDelegate from TMM"
Browse files Browse the repository at this point in the history
Summary:
Original commit changeset: d22c4abfe87f

This synchronization is redundant. See D21025965.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D21283284

fbshipit-source-id: dae737fe08bbc8f60913baa6c6a58228611257ef
  • Loading branch information
RSNara authored and facebook-github-bot committed Apr 28, 2020
1 parent 79bc7f9 commit 3d20f49
Showing 1 changed file with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public class TurboModuleManager implements JSIModule, TurboModuleRegistry {
private static volatile boolean sIsSoLibraryLoaded;
private final List<String> mEagerInitModuleNames = new ArrayList<>();
private final List<String> mEagerInitModuleNames;
private final TurboModuleProvider mJavaModuleProvider;
private final TurboModuleProvider mCxxModuleProvider;

Expand Down Expand Up @@ -64,11 +64,8 @@ public TurboModuleManager(
delegate);
installJSIBindings();

if (delegate != null) {
synchronized (delegate) {
mEagerInitModuleNames.addAll(delegate.getEagerInitModuleNames());
}
}
mEagerInitModuleNames =
delegate == null ? new ArrayList<String>() : delegate.getEagerInitModuleNames();

mJavaModuleProvider =
new TurboModuleProvider() {
Expand All @@ -78,10 +75,7 @@ public TurboModule getModule(String moduleName) {
return null;
}

/** TODO(T65532092): Should TurboModuleManagerDelegate be thread-safe? */
synchronized (delegate) {
return delegate.getModule(moduleName);
}
return delegate.getModule(moduleName);
}
};

Expand All @@ -93,13 +87,7 @@ public TurboModule getModule(String moduleName) {
return null;
}

CxxModuleWrapper nativeModule;

/** TODO(T65532092): Should TurboModuleManagerDelegate be thread-safe? */
synchronized (delegate) {
nativeModule = delegate.getLegacyCxxModule(moduleName);
}

CxxModuleWrapper nativeModule = delegate.getLegacyCxxModule(moduleName);
if (nativeModule != null) {
// TurboModuleManagerDelegate must always return TurboModules
Assertions.assertCondition(
Expand Down

0 comments on commit 3d20f49

Please sign in to comment.