Lines Matching refs:locked
38 volatile int locked; member
51 p->locked = 0; in rwlock_init()
60 assert(p->locked == 0); in rwlock_destroy()
69 while (__sync_val_compare_and_swap(&p->locked, 0, 1) == 1) in rwlock_rdlock()
79 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_rdlock()
85 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_rdlock()
94 while (__sync_val_compare_and_swap(&p->locked, 0, 1) == 1) in rwlock_wrlock()
104 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_wrlock()
110 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_wrlock()
117 while (__sync_val_compare_and_swap(&p->locked, 0, 1) == 1) in rwlock_unlock()
134 (void) __sync_fetch_and_sub(&p->locked, 1); in rwlock_unlock()