//声明信号量
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
//信号量加1
dispatch_semaphore_signal(semaphore);
//信号量减一
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
//声明信号量
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
//信号量加1
dispatch_semaphore_signal(semaphore);
//信号量减一
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
本文标题:信号量
本文链接:https://www.haomeiwen.com/subject/gdveiftx.html
网友评论