From 86411b9be8cb4890b28b39e3a374f11746838448 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Sun, 19 Aug 2012 17:57:49 -0400 Subject: [PATCH] ck_barrier_centralized: Unconditionally execute full barrier. Any side-effects should be visible after barrier boundary is crossed. --- src/ck_barrier_centralized.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ck_barrier_centralized.c b/src/ck_barrier_centralized.c index ef9f96c..50a8b09 100644 --- a/src/ck_barrier_centralized.c +++ b/src/ck_barrier_centralized.c @@ -45,14 +45,15 @@ ck_barrier_centralized(struct ck_barrier_centralized *barrier, value = ck_pr_faa_uint(&barrier->value, 1); if (value == n_threads - 1) { ck_pr_store_uint(&barrier->value, 0); - ck_pr_fence_store(); + ck_pr_fence_memory(); ck_pr_store_uint(&barrier->sense, sense); return; } - ck_pr_fence_memory(); + ck_pr_fence_load(); while (sense != ck_pr_load_uint(&barrier->sense)) ck_pr_stall(); + ck_pr_fence_memory(); return; }