dispatch_async(主队列除外都会创建新线程)
dispatch_async(dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL), ^{
NSLog(@"当前线程:%@",[NSThreadcurrentThread]);
});
dispatch_async(dispatch_queue_create(0, DISPATCH_QUEUE_SERIAL), ^{
NSLog(@"当前线程:%@",[NSThreadcurrentThread]);
});
2019-04-01 11:36:50.789655+0800 test666666[21640:2797177] 当前线程:<NSThread: 0x600002b69c40>{number = 3, name = (null)}
2019-04-01 11:36:50.789655+0800 test666666[21640:2797179] 当前线程:<NSThread: 0x600002b56500>{number = 4, name = (null)}
网友评论