Increase priority of UIManager's shadowQueue

Summary: This queue processes layout and user interface updates, so it should have as high a quality-of-service/priority as possible.

public

Reviewed By: javache

Differential Revision: D2641837

fb-gh-sync-id: 934686f7969b43101af183148d67ff7be4bdf660
This commit is contained in:
Justin Spahr-Summers 2015-11-12 06:30:48 -08:00 committed by facebook-github-bot-6
parent a1d8ea2ac1
commit 0276dde612
1 changed files with 8 additions and 1 deletions

View File

@ -219,8 +219,15 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
- (instancetype)init
{
if ((self = [super init])) {
const char *queueName = "com.facebook.React.ShadowQueue";
_shadowQueue = dispatch_queue_create("com.facebook.React.ShadowQueue", DISPATCH_QUEUE_SERIAL);
if ([NSOperation instancesRespondToSelector:@selector(qualityOfService)]) {
dispatch_queue_attr_t attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INTERACTIVE, 0);
_shadowQueue = dispatch_queue_create(queueName, attr);
} else {
_shadowQueue = dispatch_queue_create(queueName, DISPATCH_QUEUE_SERIAL);
dispatch_set_target_queue(_shadowQueue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));
}
_shadowViewRegistry = [RCTSparseArray new];
_viewRegistry = [RCTSparseArray new];