Lines Matching refs:lock
26 pthread_spin_init(pthread_spinlock_t *lock, int pshared) in pthread_spin_init() argument
30 if (lock == NULL) in pthread_spin_init()
40 l->lock = _SPINLOCK_UNLOCKED; in pthread_spin_init()
41 *lock = l; in pthread_spin_init()
46 pthread_spin_destroy(pthread_spinlock_t *lock) in pthread_spin_destroy() argument
48 if (lock == NULL || *lock == NULL) in pthread_spin_destroy()
51 if ((*lock)->owner != NULL) in pthread_spin_destroy()
54 free(*lock); in pthread_spin_destroy()
55 *lock = NULL; in pthread_spin_destroy()
60 pthread_spin_trylock(pthread_spinlock_t *lock) in pthread_spin_trylock() argument
65 if (lock == NULL || *lock == NULL) in pthread_spin_trylock()
68 l = *lock; in pthread_spin_trylock()
72 if (!_spinlocktry(&l->lock)) in pthread_spin_trylock()
80 pthread_spin_lock(pthread_spinlock_t *lock) in pthread_spin_lock() argument
85 if (lock == NULL || *lock == NULL) in pthread_spin_lock()
88 l = *lock; in pthread_spin_lock()
93 _spinlock(&l->lock); in pthread_spin_lock()
99 pthread_spin_unlock(pthread_spinlock_t *lock) in pthread_spin_unlock() argument
104 if (lock == NULL || *lock == NULL) in pthread_spin_unlock()
107 l = *lock; in pthread_spin_unlock()
113 _spinunlock(&l->lock); in pthread_spin_unlock()