Skip to content

Commit

Permalink
assert on UIBackground thread if UIBackground thread is available
Browse files Browse the repository at this point in the history
Reviewed By: raluca-elena

Differential Revision: D5008046

fbshipit-source-id: 033b9ee76b331f6a4abcf4070e1a3206d7a8a422
  • Loading branch information
aaronechiu authored and facebook-github-bot committed May 5, 2017
1 parent d353b75 commit 83a58f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -312,6 +312,14 @@ public boolean hasUIBackgroundRunnableThread() {
return mUiBackgroundMessageQueueThread != null; return mUiBackgroundMessageQueueThread != null;
} }


public void assertOnUIBackgroundOrNativeModulesThread() {
if (mUiBackgroundMessageQueueThread == null) {
assertOnNativeModulesQueueThread();
} else {
assertOnUiBackgroundQueueThread();
}
}

public void runUIBackgroundRunnable(Runnable runnable) { public void runUIBackgroundRunnable(Runnable runnable) {
if (mUiBackgroundMessageQueueThread == null) { if (mUiBackgroundMessageQueueThread == null) {
runOnNativeModulesQueueThread(runnable); runOnNativeModulesQueueThread(runnable);
Expand Down
Expand Up @@ -233,7 +233,7 @@ public void removeRootView(int rootViewTag) {
} }


public void updateNodeSize(int nodeViewTag, int newWidth, int newHeight) { public void updateNodeSize(int nodeViewTag, int newWidth, int newHeight) {
getReactApplicationContext().assertOnNativeModulesQueueThread(); getReactApplicationContext().assertOnUIBackgroundOrNativeModulesThread();


mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight); mUIImplementation.updateNodeSize(nodeViewTag, newWidth, newHeight);
} }
Expand Down

0 comments on commit 83a58f6

Please sign in to comment.