我在 GCD 中使用串行队列,例如
dispatch_queue_t myCustomQueue;
myCustomQueue = dispatch_queue_create("com.example.MyCustomQueue", NULL);
dispatch_async(myCustomQueue, ^{
....
/* some asyncronus call*/
});
在块中,我想进行异步调用,例如播放音频,
我的主要问题是,只要我进行异步调用,块就不会等待,它会完成整个块的执行。
我可以让块等待一段时间,直到异步调用的一些回调返回