【发布时间】:2019-07-24 15:43:51
【问题描述】:
我正在按照这篇文章的建议开发 iOS Core Audio:Core Audio render thread and thread signalling。
在使用dispatch_semaphore_t 的更新答案中,我了解在阅读此帖子后启用 ARC 时我不需要调用dispatch_release:Does ARC support dispatch queues?。
但是,在使用 semaphore_t 时的原始答案中(请参见下面的代码 sn-ps),我无法找到在 ARC 时是否需要通过调用 semaphore_destroy 来销毁信号量的参考已启用。有人可以帮忙吗?
semaphore_t mSemaphore;
kern_return_t result = semaphore_create(mach_task_self(), &mSemaphore, SYNC_POLICY_FIFO, 0);
// Do stuff with semaphore wait and signal ...
kern_return_t result = semaphore_destroy(mach_task_self(), mSemaphore);
提前谢谢你!
【问题讨论】:
标签: objective-c automatic-ref-counting semaphore