Permalink
Browse files

assert on UIBackground thread if UIBackground thread is available

Reviewed By: raluca-elena

Differential Revision: D5008046

fbshipit-source-id: 033b9ee76b331f6a4abcf4070e1a3206d7a8a422
  • Loading branch information...
AaaChiuuu authored and facebook-github-bot committed May 5, 2017
1 parent d353b75 commit 83a58f6c4fcb4f15c48fb82cf164414cad36c08f
@@ -312,6 +312,14 @@ public boolean hasUIBackgroundRunnableThread() {
return mUiBackgroundMessageQueueThread != null;
}
public void assertOnUIBackgroundOrNativeModulesThread() {
if (mUiBackgroundMessageQueueThread == null) {
assertOnNativeModulesQueueThread();
} else {
assertOnUiBackgroundQueueThread();
}
}
public void runUIBackgroundRunnable(Runnable runnable) {
if (mUiBackgroundMessageQueueThread == null) {
runOnNativeModulesQueueThread(runnable);
@@ -233,7 +233,7 @@ public void removeRootView(int rootViewTag) {
}
public void updateNodeSize(int nodeViewTag, int newWidth, int newHeight) {
getReactApplicationContext().assertOnNativeModulesQueueThread();
getReactApplicationContext().assertOnUIBackgroundOrNativeModulesThread();
mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight);
}

0 comments on commit 83a58f6

Please sign in to comment.