How to migrate from OSSpinLock to os_unfair_lock()?
问题 As of macOS 10.12, OSSpinLock has been deprecated. The XCode error messages urge me to use os_unfair_lock_unlock() instead. As a legacy of some open source stuff I'm relying on, I'm using RegexKitLite from 2010. How can I convert the spin lock type? Simple unlocking and locking I can manage, but these comparisons are giving me headache: if(rkl_cacheSpinLock != (OSSpinLock)0) { ... } rkl_cacheSpinLock is of type os_unfair_lock and has been initialized. OSSpinLock seems to be of type int , so