os_unfair_lock

2016-12-26  本文已影响0人  张霸天

自旋锁已经不在安全,然后苹果又整出来个 os_unfair_lock_t (╯‵□′)╯︵┻━┻这个锁解决了优先级反转问题。

os_unfair_lock_t unfairLock;     
unfairLock = &(OS_UNFAIR_LOCK_INIT);     
os_unfair_lock_lock(unfairLock);     
os_unfair_lock_unlock(unfairLock);
上一篇下一篇

猜你喜欢

热点阅读