diff --git a/include/spinlock/anderson.h b/include/spinlock/anderson.h index 2cecfb8..7800b2d 100644 --- a/include/spinlock/anderson.h +++ b/include/spinlock/anderson.h @@ -83,7 +83,7 @@ ck_spinlock_anderson_init(struct ck_spinlock_anderson *lock, else lock->wrap = 0; - ck_pr_fence_store(); + ck_pr_barrier(); return; } diff --git a/include/spinlock/cas.h b/include/spinlock/cas.h index fe76f90..acad3d5 100644 --- a/include/spinlock/cas.h +++ b/include/spinlock/cas.h @@ -49,7 +49,8 @@ CK_CC_INLINE static void ck_spinlock_cas_init(struct ck_spinlock_cas *lock) { - ck_pr_store_uint(&lock->value, false); + lock->value = false; + ck_pr_barrier(); return; } diff --git a/include/spinlock/clh.h b/include/spinlock/clh.h index dbd417d..eb98b1d 100644 --- a/include/spinlock/clh.h +++ b/include/spinlock/clh.h @@ -46,10 +46,10 @@ CK_CC_INLINE static void ck_spinlock_clh_init(struct ck_spinlock_clh **lock, struct ck_spinlock_clh *unowned) { - ck_pr_store_ptr(&unowned->previous, NULL); - ck_pr_store_uint(&unowned->wait, false); - ck_pr_store_ptr(lock, unowned); - ck_pr_fence_store(); + unowned->previous = NULL; + unowned->wait = false; + *lock = unowned; + ck_pr_barrier(); return; } diff --git a/include/spinlock/dec.h b/include/spinlock/dec.h index 22968a2..8c1e000 100644 --- a/include/spinlock/dec.h +++ b/include/spinlock/dec.h @@ -51,7 +51,8 @@ CK_CC_INLINE static void ck_spinlock_dec_init(struct ck_spinlock_dec *lock) { - ck_pr_store_uint(&lock->value, 1); + lock->value = 1; + ck_pr_barrier(); return; } diff --git a/include/spinlock/fas.h b/include/spinlock/fas.h index 625c27c..946a9ad 100644 --- a/include/spinlock/fas.h +++ b/include/spinlock/fas.h @@ -47,7 +47,8 @@ CK_CC_INLINE static void ck_spinlock_fas_init(struct ck_spinlock_fas *lock) { - ck_pr_store_uint(&lock->value, false); + lock->value = false; + ck_pr_barrier(); return; } diff --git a/include/spinlock/hclh.h b/include/spinlock/hclh.h index dcdaefc..edaeaca 100644 --- a/include/spinlock/hclh.h +++ b/include/spinlock/hclh.h @@ -49,12 +49,12 @@ ck_spinlock_hclh_init(struct ck_spinlock_hclh **lock, int cluster_id) { - ck_pr_store_ptr(&unowned->previous, NULL); - ck_pr_store_uint(&unowned->wait, false); - ck_pr_store_uint(&unowned->splice, false); - ck_pr_store_int(&unowned->cluster_id, cluster_id); - ck_pr_store_ptr(lock, unowned); - ck_pr_fence_store(); + unowned->previous = NULL; + unowned->wait = false; + unowned->splice = false; + unowned->cluster_id = cluster_id; + *lock = unowned; + ck_pr_barrier(); return; } diff --git a/include/spinlock/mcs.h b/include/spinlock/mcs.h index fb6697b..1a61e82 100644 --- a/include/spinlock/mcs.h +++ b/include/spinlock/mcs.h @@ -48,7 +48,8 @@ CK_CC_INLINE static void ck_spinlock_mcs_init(struct ck_spinlock_mcs **queue) { - ck_pr_store_ptr(queue, NULL); + *queue = NULL; + ck_pr_barrier(); return; } diff --git a/include/spinlock/ticket.h b/include/spinlock/ticket.h index 5c476bc..1fc641a 100644 --- a/include/spinlock/ticket.h +++ b/include/spinlock/ticket.h @@ -79,7 +79,7 @@ ck_spinlock_ticket_init(struct ck_spinlock_ticket *ticket) { ticket->value = 0; - ck_pr_fence_store(); + ck_pr_barrier(); return; } @@ -203,7 +203,7 @@ ck_spinlock_ticket_init(struct ck_spinlock_ticket *ticket) ticket->next = 0; ticket->position = 0; - ck_pr_fence_store(); + ck_pr_barrier(); return; }