美文网首页
dispatch_semaphore 信号量互斥 解决下个请求

dispatch_semaphore 信号量互斥 解决下个请求

作者: 又又轻 | 来源:发表于2016-08-24 09:30 被阅读45次

    dispatch_queue_t queque = dispatch_queue_create("GoyakodCreated", DISPATCH_QUEUE_CONCURRENT);

    dispatch_async(queque, ^{

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    [self getToken:semaphore];/*dispatch_semaphore_signal(semaphore)*/

    dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);

    [self request];

    });

    相关文章

      网友评论

          本文标题:dispatch_semaphore 信号量互斥 解决下个请求

          本文链接:https://www.haomeiwen.com/subject/mttfdttx.html