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
.
精彩评论