iOS中的互锁操作? [英] Interlocked operations in iOS?
本文介绍了iOS中的互锁操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
iOS SDK中是否有互锁(原子)操作?
Are there interlocked(atomic) operations in iOS SDK?
我需要互锁的increment \decrement和互锁的比较。
I need interlocked increment\decrement and interlocked comparsion.
* 更新:* 我的主要问题是等待几个由主线程创建的NSThreads(主线程不能工作, 。
*UPDATE: * My main problem is waiting for few NSThreads created by main thread(main thread mustn't work while other threads work).
我不知道该怎么做。
推荐答案
You can use the OSAtomicIncrement*
/OSAtomicDecrement*
operations described in Using Atomic Operations.
这篇关于iOS中的互锁操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文