[TIMOB-26407] iOS: Replace OSSpinLock API with os_unfair_lock
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2018-09-22T15:19:21.000+0000 |
Updated | 2018-09-22T15:20:38.000+0000 |
Description
We use the
OSSpinlock
API in your kroll-core and some XML operations a lot. It has formally been deprecated as of iOS 10.0 and should be replaced by the os_unfair_lock
(os_unfair_lock_lock
and os_unfair_lock_unlock
) API. The old API is meant to be unsafe on newer OS's, leading to possible crashes.
Note: Also the os_unfair_lock
is a suggested replacement by Apple, we may want to consider other locks that are more GCD focussed.
Docs:
- https://github.com/moby/hyperkit/issues/47
- https://developer.apple.com/documentation/os/1646466-os_unfair_lock_lock
- https://blog.postmates.com/why-spinlocks-are-bad-on-ios-b69fc5221058
No comments