diff --git a/include/ck_brlock.h b/include/ck_brlock.h index c3307d9..2a21f0d 100644 --- a/include/ck_brlock.h +++ b/include/ck_brlock.h @@ -198,6 +198,7 @@ ck_brlock_read_lock(struct ck_brlock *br, struct ck_brlock_reader *reader) ck_pr_store_uint(&reader->n_readers, 0); } + ck_pr_fence_load(); return; } @@ -235,6 +236,7 @@ ck_brlock_read_trylock(struct ck_brlock *br, return false; } + ck_pr_fence_load(); return true; } diff --git a/include/ck_bytelock.h b/include/ck_bytelock.h index 2be30dc..8970aa1 100644 --- a/include/ck_bytelock.h +++ b/include/ck_bytelock.h @@ -143,6 +143,7 @@ ck_bytelock_read_lock(struct ck_bytelock *bytelock, unsigned int slot) ck_pr_stall(); } + ck_pr_fence_load(); return; } diff --git a/include/ck_rwlock.h b/include/ck_rwlock.h index f3df10d..f9e24c1 100644 --- a/include/ck_rwlock.h +++ b/include/ck_rwlock.h @@ -113,6 +113,7 @@ ck_rwlock_read_trylock(ck_rwlock_t *rw) return false; leave: + ck_pr_fence_load(); return true; } @@ -131,6 +132,7 @@ ck_rwlock_read_lock(ck_rwlock_t *rw) ck_pr_dec_uint(&rw->n_readers); } + ck_pr_fence_load(); return; }