Commit 227f9fab authored by Josh Kunz's avatar Josh Kunz

Fix style of the OSX compat header. spaces -> tabs

parent 45e25410
......@@ -4,11 +4,11 @@
#include <Availability.h>
#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_4
#error "OSSpinLock only supported from on OSX 10.4+"
#endif
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_4
#error "OSSpinLock only supported from on OSX 10.4+"
#endif
#else
#error "__MAC_OS_X_VERSION_MIN_REQUIRED macro not supported on this platform"
#error "__MAC_OS_X_VERSION_MIN_REQUIRED macro not supported on this platform"
#endif
#include <assert.h>
......@@ -17,31 +17,31 @@
typedef OSSpinLock pthread_spinlock_t;
static int pthread_spin_init(pthread_spinlock_t *lock, int pshared) {
assert(pshared == PTHREAD_PROCESS_PRIVATE &&
"PTHREAD_PROCESS_SHARED not supported on OSX");
*lock = OS_SPINLOCK_INIT;
return 0;
assert(pshared == PTHREAD_PROCESS_PRIVATE &&
"PTHREAD_PROCESS_SHARED not supported on OSX");
*lock = OS_SPINLOCK_INIT;
return 0;
}
static int pthread_spin_destroy(pthread_spinlock_t *lock) { return 0; }
static int pthread_spin_lock(pthread_spinlock_t *lock) {
OSSpinLockLock(lock);
return 0;
OSSpinLockLock(lock);
return 0;
}
/* OSSpinLockTry returns false when it fails to acquire the lock, seems
* to be equivalent to EBUSY under the standard API */
static int pthread_spin_trylock(pthread_spinlock_t *lock) {
if (OSSpinLockTry(lock) == true) {
return 0;
} else {
return EBUSY;
}
if (OSSpinLockTry(lock) == true) {
return 0;
} else {
return EBUSY;
}
}
static int pthread_spin_unlock(pthread_spinlock_t *lock) {
OSSpinLockUnlock(lock);
return 0;
OSSpinLockUnlock(lock);
return 0;
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment