From cdfac8213f83e47475238b6852ed236897e136fb Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 17 Apr 2014 16:17:16 -0400 Subject: [PATCH] Revert "ck_rwlock: Re-observe latch bits if necessary." This reverts commit fa286223861165ee5617712a9bf9c6e6553be3fd. --- include/ck_rwlock.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/include/ck_rwlock.h b/include/ck_rwlock.h index e89db6f..b5d2416 100644 --- a/include/ck_rwlock.h +++ b/include/ck_rwlock.h @@ -214,21 +214,8 @@ ck_rwlock_read_lock(ck_rwlock_t *rw) */ ck_pr_fence_atomic_load(); - if (ck_pr_load_32(&rw->writer) == 0) { - /* - * It is possible that a latch operation has itself - * gone unnoticed across a write-side critical section. - * However, the write-side critical section itself - * guarantees an ordering with respect to the previous - * fence operation. If writer is observed to 0, then - * it is guaranteed that the latch will be visible. - */ - snapshot = ck_pr_load_32(&rw->n_readers); - if (snapshot >> CK_RWLOCK_LATCH_SHIFT) - continue; - + if (ck_pr_load_32(&rw->writer) == 0) break; - } ck_pr_dec_32(&rw->n_readers); }