iphone - iOS 中的联锁操作?

标签 iphone objective-c ios concurrency

iOS SDK 中是否存在互锁(原子)操作?

我需要互锁递增\递减和互锁比较。

*更新:* 我的主要问题是等待主线程创建的几个 NSThread(主线程不能在其他线程工作时工作)。

我不知道怎么做。

最佳答案

您可以使用 Using Atomic Operations 中描述的 OSAtomicIncrement*/OSAtomicDecrement* 操作.

关于iphone - iOS 中的联锁操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4862308/

相关文章:

iphone - 搜索核心数据与 Plist

ios - 如何通过 iOS Social.framework 在 fb 和 twitter 上上传多张照片?

ios - UITableView - 使用 reloadRowsAtIndexPath

ios - SwiftUI 图表 : Adding Label To Bar Chart Bar

ios - RestKit 0.23.3 : mapping same key twice (or even more often) does not work

ios - 仅从 UIView 的 3 个侧面绘制阴影

ios - 通用链接不适用于 iOS10

iphone - SplitViewController 问题 - 在纵向模式下替换详细 View Controller 失败

iphone - Three20 和 iOS 4

ios - 键盘出现时移动 subview