From e274a49ffdcc1db0b2db471a4b765e56662c2cb6 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 17 Feb 2018 19:28:09 +0100 Subject: [PATCH] Fix bug as we can't fail spuriously here. --- m-snapshot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m-snapshot.h b/m-snapshot.h index dbdc8deb..548b1480 100644 --- a/m-snapshot.h +++ b/m-snapshot.h @@ -374,7 +374,7 @@ static inline unsigned int snapshot_mrsw_int_read_start(snapshot_mrsw_int_t s) unsigned int c = atomic_fetch_add(&s->cptTab[idx], 1); assert (c <= s->n + 1); // Try to ack it - if (atomic_compare_exchange_weak(&s->lastNext, &previous, newNext)) + if (atomic_compare_exchange_strong(&s->lastNext, &previous, newNext)) break; // If we have been preempted by another read thread if (idx == SNAPSHOTI_MRSW_INT_FLAG_W(previous)) {