mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 17:54:48 +00: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:
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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user