diff --git a/include/ck_brlock.h b/include/ck_brlock.h index 2a21f0d..5722cbd 100644 --- a/include/ck_brlock.h +++ b/include/ck_brlock.h @@ -187,10 +187,10 @@ ck_brlock_read_lock(struct ck_brlock *br, struct ck_brlock_reader *reader) while (ck_pr_load_uint(&br->writer) == true) ck_pr_stall(); - ck_pr_store_uint(&reader->n_readers, 1); + ck_pr_fas_uint(&reader->n_readers, 1); - /* Loads are re-ordered with respect to prior stores. */ - ck_pr_fence_strict_memory(); + /* Serialize counter update with respect to writer snapshot. */ + ck_pr_fence_memory(); if (ck_pr_load_uint(&br->writer) == false) break;