From f3539396c2400fb3517796182eb4ed3b9b0ad84c Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Mon, 21 Apr 2014 12:50:58 -0400 Subject: [PATCH] *lock: Simply use compiler barrier on initialization. --- include/ck_brlock.h | 2 +- include/ck_bytelock.h | 2 +- include/ck_rwlock.h | 2 +- include/ck_tflock.h | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/ck_brlock.h b/include/ck_brlock.h index 092c61b..d59f0e9 100644 --- a/include/ck_brlock.h +++ b/include/ck_brlock.h @@ -67,7 +67,7 @@ ck_brlock_init(struct ck_brlock *br) br->readers = NULL; br->writer = false; - ck_pr_fence_store(); + ck_pr_barrier(); return; } diff --git a/include/ck_bytelock.h b/include/ck_bytelock.h index 6c682a5..cd855cf 100644 --- a/include/ck_bytelock.h +++ b/include/ck_bytelock.h @@ -62,7 +62,7 @@ ck_bytelock_init(struct ck_bytelock *bytelock) for (i = 0; i < sizeof bytelock->readers; i++) bytelock->readers[i] = false; - ck_pr_fence_store(); + ck_pr_barrier(); return; } diff --git a/include/ck_rwlock.h b/include/ck_rwlock.h index 6d9885c..63cb549 100644 --- a/include/ck_rwlock.h +++ b/include/ck_rwlock.h @@ -46,7 +46,7 @@ ck_rwlock_init(struct ck_rwlock *rw) rw->writer = 0; rw->n_readers = 0; - ck_pr_fence_store(); + ck_pr_barrier(); return; } diff --git a/include/ck_tflock.h b/include/ck_tflock.h index 9359185..391fb73 100644 --- a/include/ck_tflock.h +++ b/include/ck_tflock.h @@ -74,6 +74,7 @@ ck_tflock_ticket_init(struct ck_tflock_ticket *pf) { pf->request = pf->completion = 0; + ck_pr_barrier(); return; }