facebookarchive / KVOController

Simple, modern, thread-safe key-value observing for iOS and OS X.
Other
7.34k stars 925 forks source link

Replace usage of OSSpinLock with pthread_mutex #108

Closed nlutsenko closed 8 years ago

nlutsenko commented 8 years ago

Spin locks are are vulnerable to live locking on iOS in cases of priority inversion: • http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html

We should replace all usage of OSSpinLock in KVOController with pthread_mutex or dispatch queues (the former is probably a way to go, since it's faster unless we give a queue a huge priority).