dispatch_async(主隊(duì)列除外都會(huì)創(chuàng)建新線程)
dispatch_async(dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL), ^{
? ? ? ? NSLog(@"當(dāng)前線程:%@",[NSThreadcurrentThread]);
? ? });
? ? dispatch_async(dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL), ^{
? ? ? ? NSLog(@"當(dāng)前線程:%@",[NSThreadcurrentThread]);
? ? });
2019-04-01 11:36:50.789655+0800 test666666[21640:2797177] 當(dāng)前線程:<NSThread: 0x600002b69c40>{number = 3, name = (null)}
2019-04-01 11:36:50.789655+0800 test666666[21640:2797179] 當(dāng)前線程:<NSThread: 0x600002b56500>{number = 4, name = (null)}