From bf8779ab13f1d8563dd1f61541e16e5a5c53943a Mon Sep 17 00:00:00 2001 From: Jaidev Sridhar Date: Fri, 18 Apr 2014 22:02:34 +0000 Subject: [PATCH] ck_swlock: Decrement n_readers in TATAS style loop. --- include/ck_swlock.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/ck_swlock.h b/include/ck_swlock.h index e67c433..63040c4 100644 --- a/include/ck_swlock.h +++ b/include/ck_swlock.h @@ -220,6 +220,7 @@ ck_swlock_read_latchlock(ck_swlock_t *rw) /* Writer has latched, stall the reader */ if (ck_pr_faa_32(&rw->n_readers, 1) & CK_SWLOCK_LATCH_BIT) { + ck_pr_dec_32(&rw->n_readers); do { ck_pr_stall(); } while (ck_pr_load_32(&rw->n_readers) & CK_SWLOCK_LATCH_BIT);