mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 22:40:55 +08:00
bump up priority of RN threads during startup
Reviewed By: shergin, yungsters Differential Revision: D5002320 fbshipit-source-id: 8467370940d3742266b3bf319e9a38ae22eab98e
This commit is contained in:
committed by
Facebook Github Bot
parent
1dd7bc1515
commit
82c4b9f0b7
@@ -742,7 +742,7 @@ public class ReactInstanceManager {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY);
|
||||
final ReactApplicationContext reactApplicationContext = createReactContext(
|
||||
initParams.getJsExecutorFactory().create(),
|
||||
initParams.getJsBundleLoader());
|
||||
@@ -827,6 +827,26 @@ public class ReactInstanceManager {
|
||||
}
|
||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
ReactMarker.logMarker(SETUP_REACT_CONTEXT_END);
|
||||
mCurrentReactContext.runOnJSQueueThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
|
||||
}
|
||||
});
|
||||
mCurrentReactContext.runOnNativeModulesQueueThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
|
||||
}
|
||||
});
|
||||
if (mUseSeparateUIBackgroundThread) {
|
||||
mCurrentReactContext.runOnUiBackgroundQueueThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void attachMeasuredRootViewToInstance(
|
||||
|
||||
Reference in New Issue
Block a user