diff --git a/src/ck_barrier_centralized.c b/src/ck_barrier_centralized.c index 509807e..cdc2a4c 100644 --- a/src/ck_barrier_centralized.c +++ b/src/ck_barrier_centralized.c @@ -50,7 +50,7 @@ ck_barrier_centralized(struct ck_barrier_centralized *barrier, return; } - ck_pr_fence_load(); + ck_pr_fence_atomic_load(); while (sense != ck_pr_load_uint(&barrier->sense)) ck_pr_stall(); diff --git a/src/ck_barrier_dissemination.c b/src/ck_barrier_dissemination.c index 94c4aa5..1663f20 100644 --- a/src/ck_barrier_dissemination.c +++ b/src/ck_barrier_dissemination.c @@ -119,5 +119,6 @@ ck_barrier_dissemination(struct ck_barrier_dissemination *barrier, state->sense = ~state->sense; state->parity = 1 - state->parity; + ck_pr_fence_memory(); return; } diff --git a/src/ck_barrier_mcs.c b/src/ck_barrier_mcs.c index 85ba4cf..3b1add6 100644 --- a/src/ck_barrier_mcs.c +++ b/src/ck_barrier_mcs.c @@ -136,5 +136,6 @@ ck_barrier_mcs(struct ck_barrier_mcs *barrier, ck_pr_store_uint(barrier[state->vpid].children[0], state->sense); ck_pr_store_uint(barrier[state->vpid].children[1], state->sense); state->sense = ~state->sense; + ck_pr_fence_memory(); return; } diff --git a/src/ck_barrier_tournament.c b/src/ck_barrier_tournament.c index ccb23b6..e232dbc 100644 --- a/src/ck_barrier_tournament.c +++ b/src/ck_barrier_tournament.c @@ -178,6 +178,7 @@ wakeup: } leave: + ck_pr_fence_memory(); state->sense = ~state->sense; return; }