Skip to content

Commit ed0f8d6

Browse files
committed
[General] Fix invalid identifier passed to dispatch_get_global_queue
on iOS < 8.0
1 parent 1b95266 commit ed0f8d6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎Sources/classdumpctl/main.m‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,15 @@ int main(int argc, char *argv[]) {
700700

701701
// use a group so we can make sure all the work items finish before we exit the program
702702
dispatch_group_t const linesWriteGroup = dispatch_group_create();
703+
704+
intptr_t linesWriteQueueIdentifier;
705+
if (@available(macOS 10.10, iOS 8.0, *)) {
706+
linesWriteQueueIdentifier = QOS_CLASS_USER_INITIATED;
707+
} else {
708+
linesWriteQueueIdentifier = DISPATCH_QUEUE_PRIORITY_HIGH;
709+
}
703710
// perform file system writes on another thread so we don't unnecessarily block our CPU work
704-
dispatch_queue_t const linesWriteQueue = dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0);
711+
dispatch_queue_t const linesWriteQueue = dispatch_get_global_queue(linesWriteQueueIdentifier, 0);
705712

706713
unsigned int classCount = 0;
707714
const char **classNames = objc_copyClassNamesForImage(imagePath.fileSystemRepresentation, &classCount);

0 commit comments

Comments
 (0)