mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-12 11:40:33 +08:00
assert on UIBackground thread if UIBackground thread is available
Reviewed By: raluca-elena Differential Revision: D5008046 fbshipit-source-id: 033b9ee76b331f6a4abcf4070e1a3206d7a8a422
This commit is contained in:
committed by
Facebook Github Bot
parent
d353b75c12
commit
83a58f6c4f
@@ -312,6 +312,14 @@ public class ReactContext extends ContextWrapper {
|
||||
return mUiBackgroundMessageQueueThread != null;
|
||||
}
|
||||
|
||||
public void assertOnUIBackgroundOrNativeModulesThread() {
|
||||
if (mUiBackgroundMessageQueueThread == null) {
|
||||
assertOnNativeModulesQueueThread();
|
||||
} else {
|
||||
assertOnUiBackgroundQueueThread();
|
||||
}
|
||||
}
|
||||
|
||||
public void runUIBackgroundRunnable(Runnable runnable) {
|
||||
if (mUiBackgroundMessageQueueThread == null) {
|
||||
runOnNativeModulesQueueThread(runnable);
|
||||
|
||||
Reference in New Issue
Block a user