Make ShadowNodeRegistry thread safe
Reviewed By: achen1 Differential Revision: D7679621 fbshipit-source-id: 1003578edcf9107b736d876dac969f22f9e62b6d
This commit is contained in:
parent
3aa453d975
commit
dc836780cb
|
@ -28,9 +28,7 @@ public class ShadowNodeRegistry {
|
|||
}
|
||||
|
||||
public void addRootNode(ReactShadowNode node) {
|
||||
// TODO(6242243): This should be asserted... but UIManagerModule is
|
||||
// thread-unsafe and calls this on the wrong thread.
|
||||
//mThreadAsserter.assertNow();
|
||||
mThreadAsserter.assertNow();
|
||||
int tag = node.getReactTag();
|
||||
mTagsToCSSNodes.put(tag, node);
|
||||
mRootTags.put(tag, true);
|
||||
|
|
|
@ -205,7 +205,12 @@ public class UIImplementation {
|
|||
int heightMeasureSpec = rootView.getHeightMeasureSpec();
|
||||
updateRootView(rootCSSNode, widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
mShadowNodeRegistry.addRootNode(rootCSSNode);
|
||||
context.runOnNativeModulesQueueThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mShadowNodeRegistry.addRootNode(rootCSSNode);
|
||||
}
|
||||
});
|
||||
|
||||
// register it within NativeViewHierarchyManager
|
||||
mOperationsQueue.addRootView(tag, rootView, context);
|
||||
|
|
Loading…
Reference in New Issue