29 lines · plain
1#import <dispatch/dispatch.h>2#include <stdio.h>3 4void one() {5 printf("one...\n"); // breakpoint 16}7 8void two() {9 printf("two...\n");10 one();11}12 13void three() {14 printf("three...\n");15 two();16}17 18int main(int argc, char *argv[]) {19 printf("main...\n");20 // Nest from main queue > global queue > main queue.21 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),22 ^{23 dispatch_async(dispatch_get_main_queue(), ^{24 three();25 });26 });27 dispatch_main();28}29