diff options
Diffstat (limited to 'libglusterfs/src')
| -rw-r--r-- | libglusterfs/src/locking.h | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/libglusterfs/src/locking.h b/libglusterfs/src/locking.h index a66cdc188db..24edf9aed44 100644 --- a/libglusterfs/src/locking.h +++ b/libglusterfs/src/locking.h @@ -12,6 +12,15 @@  #define _LOCKING_H  #include <pthread.h> +#ifdef GF_DARWIN_HOST_OS +#include <libkern/OSAtomic.h> +#define pthread_spinlock_t OSSpinLock +#define pthread_spin_lock(l) OSSpinLockLock(l) +#define pthread_spin_unlock(l) OSSpinLockUnlock(l) +#define pthread_spin_destroy(l) 0 +#define pthread_spin_init(l, v) (*l = v) +#endif +  #if HAVE_SPINLOCK  #define LOCK_INIT(x)    pthread_spin_init (x, 0)  | 
