?dispatch_queue_t queue = dispatch_queue_create("test", NULL);
? ? dispatch_async(queue, ^{
? ? ? ? NSLog(@"1");
? ? ? ? dispatch_sync(queue, ^{
? ? ? ? ? ? NSLog(@"2");
? ? ? ? });
? ? });
? ? NSLog(@"3");
輸出為3,1,當(dāng)執(zhí)行nslog(@"2")時產(chǎn)生自鎖崩潰
同步線程的執(zhí)行要在當(dāng)前線程任務(wù)完成時再執(zhí)行其他