Use the low priority dispatch queue for update checks

Presently mainly a semantic change, as the dispatch queues are mostly empty, but as we adopt GCD for more things, it’ll be more important to put background tasks in a queue with lower priority than the one handling user requested tasks.
This commit is contained in:
Allan Odgaard
2012-12-20 13:30:53 +01:00
parent 2374aafde2
commit 601cf28366

View File

@@ -139,7 +139,7 @@ static SoftwareUpdate* SharedInstance;
return;
self.isChecking = YES;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
std::string error = NULL_STR;
auto info = sw_update::download_info(to_s([anURL absoluteString]), &error);
@@ -226,7 +226,7 @@ static SoftwareUpdate* SharedInstance;
NSTimer* updateProgressTimer = [NSTimer scheduledTimerWithTimeInterval:0.04 target:self selector:@selector(updateProgress:) userInfo:[NSDate date] repeats:YES];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
shared_state_ptr state = sharedState;
std::string error = NULL_STR;
std::string path = sw_update::download_update(to_s(downloadURL), keyChain, &error, &state->progress, &state->stop);