Lines Matching refs:lock

95 extern void internal_function __pthread_lock(struct _pthread_fastlock * lock,
97 extern int __pthread_unlock(struct _pthread_fastlock *lock);
99 static __inline__ void __pthread_init_lock(struct _pthread_fastlock * lock) in __pthread_init_lock() argument
101 lock->__status = 0; in __pthread_init_lock()
102 lock->__spinlock = __LT_SPINLOCK_INIT; in __pthread_init_lock()
105 static __inline__ int __pthread_trylock (struct _pthread_fastlock * lock) in __pthread_trylock() argument
112 return (testandset(&lock->__spinlock) ? EBUSY : 0); in __pthread_trylock()
118 if (lock->__status != 0) return EBUSY; in __pthread_trylock()
119 } while(! __compare_and_swap(&lock->__status, 0, 1)); in __pthread_trylock()
128 extern void __pthread_alt_lock(struct _pthread_fastlock * lock,
131 extern int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
134 extern void __pthread_alt_unlock(struct _pthread_fastlock *lock);
136 static __inline__ void __pthread_alt_init_lock(struct _pthread_fastlock * lock) in __pthread_alt_init_lock() argument
138 lock->__status = 0; in __pthread_alt_init_lock()
139 lock->__spinlock = __LT_SPINLOCK_INIT; in __pthread_alt_init_lock()
142 static __inline__ int __pthread_alt_trylock (struct _pthread_fastlock * lock) in __pthread_alt_trylock() argument
151 if (testandset(&lock->__spinlock) == 0) in __pthread_alt_trylock()
153 if (lock->__status == 0) in __pthread_alt_trylock()
155 lock->__status = 1; in __pthread_alt_trylock()
159 lock->__spinlock = __LT_SPINLOCK_INIT; in __pthread_alt_trylock()
167 if (lock->__status != 0) return EBUSY; in __pthread_alt_trylock()
168 } while(! compare_and_swap(&lock->__status, 0, 1, &lock->__spinlock)); in __pthread_alt_trylock()