Skip to content

Replace OSSpinLock with os_unfair_lock when building for macOS 10.12,…#410

Merged
robbiehanson merged 1 commit into
yapstudios:masterfrom
fabiankr:lock
Jul 18, 2017
Merged

Replace OSSpinLock with os_unfair_lock when building for macOS 10.12,…#410
robbiehanson merged 1 commit into
yapstudios:masterfrom
fabiankr:lock

Conversation

@fabiankr
Copy link
Copy Markdown
Contributor

… iOS 10.0, watchOS 3.0 or tvOS 10.0.

OSSpinLock is deprecated and should be replaced by os_unfair_lock. However, os_unfair_lock is not available prior to the aforementioned platforms. Added some defined to seamlessly map between OSSpinLock and os_unfair_lock in YapDatabaseAtomic.h.

YapDatabase deploys to earlier versions so OSSpinLock is still used by default. But if consumers of the framework decide to rebuild it for more modern platforms, os_unfair_lock will be used.

I've added the file YapDatabaseAtomic.h, because it didn't really fit in any of the other headers. It could maybe be moved to YapDatabasePrivate.h, but I think a new header is more fitting.

… iOS 10.0, watchOS 3.0 or tvOS 10.0.

OSSpinLock is deprecated and should be replaced by os_unfair_lock. However, os_unfair_lock is not available prior to the aforementioned platforms. Added some defined to seamlessly map between OSSpinLock and os_unfair_lock in YapDatabaseAtomic.h.

YapDatabase deploys to earlier versions so OSSpinLock is still used by default. But if consumers of the framework decide to rebuild it for more modern platforms, os_unfair_lock will be used.
@robbiehanson robbiehanson merged commit 04eb3b9 into yapstudios:master Jul 18, 2017
@robbiehanson
Copy link
Copy Markdown
Contributor

robbiehanson commented Jul 18, 2017

Perfect ! Thank you.

@fabiankr fabiankr deleted the lock branch July 19, 2017 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants