mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-07 22:42:13 +08:00
Increase QoS of JavaScript thread on iOS 8+
Summary: This thread is effectively the "main thread" for JavaScript code in React Native applications, so it should have as high a quality-of-service as possible. public Reviewed By: javache, nicklockwood Differential Revision: D2641878 fb-gh-sync-id: 3c60c1abeeab9e7405d6fc9602e0d4ccfab1ea1b
This commit is contained in:
committed by
facebook-github-bot-6
parent
ce2bb0fe16
commit
a1d8ea2ac1
@@ -279,7 +279,13 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
||||
selector:@selector(runRunLoopThread)
|
||||
object:nil];
|
||||
javaScriptThread.name = @"com.facebook.React.JavaScript";
|
||||
javaScriptThread.threadPriority = [NSThread mainThread].threadPriority;
|
||||
|
||||
if ([javaScriptThread respondsToSelector:@selector(setQualityOfService:)]) {
|
||||
[(id)javaScriptThread setQualityOfService:NSOperationQualityOfServiceUserInteractive];
|
||||
} else {
|
||||
javaScriptThread.threadPriority = [NSThread mainThread].threadPriority;
|
||||
}
|
||||
|
||||
[javaScriptThread start];
|
||||
|
||||
return [self initWithJavaScriptThread:javaScriptThread context:nil];
|
||||
|
||||
Reference in New Issue
Block a user