Lines Matching refs:locked
28 volatile int locked; member
41 p->locked = 0; in rwlock_init()
50 assert(p->locked == 0); in rwlock_destroy()
59 while (__sync_val_compare_and_swap(&p->locked, 0, 1) == 1) in rwlock_rdlock()
69 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_rdlock()
75 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_rdlock()
83 while (__sync_val_compare_and_swap(&p->locked, 0, 1) == 1) in rwlock_wrlock()
93 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_wrlock()
99 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_wrlock()
105 while (__sync_val_compare_and_swap(&p->locked, 0, 1) == 1) in rwlock_unlock()
120 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_unlock()