17 #include <libkern/OSAtomic.h>
18 #define PTHREAD_LOCK_T OSSpinLock
19 #define PTHREAD_LOCK_INIT(lock) *lock = OS_SPINLOCK_INIT
20 #define PTHREAD_LOCK_DESTROY(lock)
21 #define PTHREAD_LOCK(lock) OSSpinLockLock(lock)
22 #define PTHREAD_UNLOCK(lock) OSSpinLockUnlock(lock)
24 #define PTHREAD_LOCK_T pthread_spinlock_t
25 #define PTHREAD_LOCK_INIT(lock) pthread_spin_init(lock, 0)
26 #define PTHREAD_LOCK_DESTROY(lock) pthread_spin_destroy(lock)
27 #define PTHREAD_LOCK(lock) pthread_spin_lock(lock)
28 #define PTHREAD_UNLOCK(lock) pthread_spin_unlock(lock)
31 #define PTHREAD_LOCK_T pthread_mutex_t
32 #define PTHREAD_LOCK_INIT(lock) pthread_mutex_init(lock, NULL)
33 #define PTHREAD_LOCK_DESTROY(lock) pthread_mutex_destroy(lock)
34 #define PTHREAD_LOCK(lock) pthread_mutex_lock(lock)
35 #define PTHREAD_UNLOCK(lock) pthread_mutex_unlock(lock)
44 lock_object=(
void*) SG_MALLOC(PTHREAD_LOCK_T, 1);
45 PTHREAD_LOCK_INIT((PTHREAD_LOCK_T*) lock_object);
52 PTHREAD_LOCK_DESTROY((PTHREAD_LOCK_T*) lock_object);
60 PTHREAD_LOCK((PTHREAD_LOCK_T*) lock_object);
67 PTHREAD_UNLOCK((PTHREAD_LOCK_T*) lock_object);
all of classes and functions are contained in the shogun namespace