ck_swlock: Decrement n_readers in TATAS style loop.

ck_pring
Jaidev Sridhar 11 years ago
parent 3412f135df
commit bf8779ab13

@ -220,6 +220,7 @@ ck_swlock_read_latchlock(ck_swlock_t *rw)
/* Writer has latched, stall the reader */ /* Writer has latched, stall the reader */
if (ck_pr_faa_32(&rw->n_readers, 1) & CK_SWLOCK_LATCH_BIT) { if (ck_pr_faa_32(&rw->n_readers, 1) & CK_SWLOCK_LATCH_BIT) {
ck_pr_dec_32(&rw->n_readers);
do { do {
ck_pr_stall(); ck_pr_stall();
} while (ck_pr_load_32(&rw->n_readers) & CK_SWLOCK_LATCH_BIT); } while (ck_pr_load_32(&rw->n_readers) & CK_SWLOCK_LATCH_BIT);

Loading…
Cancel
Save