Files

31 lines
907 B
Diff
Raw Permalink Normal View History

2018-11-02 10:16:49 -07:00
--- src/ptex/PtexPlatform.h.orig 2018-04-10 15:47:40.000000000 -0700
+++ src/ptex/PtexPlatform.h 2018-11-02 09:28:24.000000000 -0700
@@ -67,7 +67,7 @@
#include <pthread.h>
#ifdef __APPLE__
-#include <os/lock.h>
+#include <libkern/OSAtomic.h>
#include <sys/types.h>
#endif
#endif
@@ -136,13 +136,13 @@
#ifdef __APPLE__
class SpinLock {
public:
- SpinLock() { _spinlock = OS_UNFAIR_LOCK_INIT; }
+ SpinLock() { _spinlock = 0; }
~SpinLock() { }
- void lock() { os_unfair_lock_lock(&_spinlock); }
- bool trylock() { return os_unfair_lock_trylock(&_spinlock); }
- void unlock() { os_unfair_lock_unlock(&_spinlock); }
+ void lock() { OSSpinLockLock(&_spinlock); }
+ bool trylock() { return OSSpinLockTry(&_spinlock); }
+ void unlock() { OSSpinLockUnlock(&_spinlock); }
private:
- os_unfair_lock _spinlock;
+ OSSpinLock _spinlock;
};
#else
class SpinLock {