From 910dd883e3d7c349abb7021053dde78f4da1202e Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Wed, 2 Nov 2016 18:01:01 -0700 Subject: [PATCH] Have sharedOperationQueue have at least 2 max operations. (#139) On devices without multiple cores it's still useful to allow multiple operations to run at once. --- PINCache/PINOperationQueue.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PINCache/PINOperationQueue.m b/PINCache/PINOperationQueue.m index 0f95a6ef..24284a56 100644 --- a/PINCache/PINOperationQueue.m +++ b/PINCache/PINOperationQueue.m @@ -112,7 +112,7 @@ + (instancetype)sharedOperationQueue static PINOperationQueue *sharedOperationQueue = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - sharedOperationQueue = [[PINOperationQueue alloc] initWithMaxConcurrentOperations:[[NSProcessInfo processInfo] activeProcessorCount]]; + sharedOperationQueue = [[PINOperationQueue alloc] initWithMaxConcurrentOperations:MAX([[NSProcessInfo processInfo] activeProcessorCount], 2)]; }); return sharedOperationQueue; }