开发者

NSLocks in Objective C

We use NSLock fo开发者_高级运维r locking in Objective C. I am porting a c plus plus code. There they have used locks for critical section and mutex locks. Is NSLock sufficient to lock critical section as well as mutex.


I'd say that NSLock is sufficient, but if you think that you might have to lock while the lock is already locked (thereby causing a deadlock), you may want to look at NSRecursiveLock.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜