diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2019-09-14 21:23:29 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2019-09-14 21:23:29 +0300 |
commit | 9d282d7a8d689a17ae58e94453ae99a41e91b701 (patch) | |
tree | 4c4bbd145df1c5b34d5779782964129742e30162 /intern/cycles/util | |
parent | ea70bd2abf7c178076a403dd071fcf593b79c20c (diff) |
macOS: Replaced OSSpinLock with os_unfair_lock.
OSSplinLock is a deprecated API, os_unfair_lock is its successor.
This reduces the number of warnings when building on macOS.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_thread.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h index 18ec5b32144..a9cfc309e0d 100644 --- a/intern/cycles/util/util_thread.h +++ b/intern/cycles/util/util_thread.h @@ -30,7 +30,7 @@ #endif #ifdef __APPLE__ -# include <libkern/OSAtomic.h> +# include <os/lock.h> #endif #include "util/util_function.h" @@ -72,17 +72,17 @@ class thread_spin_lock { #ifdef __APPLE__ inline thread_spin_lock() { - spin_ = OS_SPINLOCK_INIT; + spin_ = OS_UNFAIR_LOCK_INIT; } inline void lock() { - OSSpinLockLock(&spin_); + os_unfair_lock_lock(&spin_); } inline void unlock() { - OSSpinLockUnlock(&spin_); + os_unfair_lock_unlock(&spin_); } #elif defined(_WIN32) inline thread_spin_lock() @@ -128,7 +128,7 @@ class thread_spin_lock { #endif protected: #ifdef __APPLE__ - OSSpinLock spin_; + os_unfair_lock spin_; #elif defined(_WIN32) CRITICAL_SECTION cs_; #else |