diff --git a/include/ck_fifo.h b/include/ck_fifo.h index edb2059..707bc1e 100644 --- a/include/ck_fifo.h +++ b/include/ck_fifo.h @@ -144,6 +144,8 @@ ck_fifo_spsc_dequeue(struct ck_fifo_spsc *fifo, void *value) /* If entry is visible, guarantee store to value is visible. */ ck_pr_fence_load(); ck_pr_store_ptr(value, entry->value); + + ck_pr_fence_store(); ck_pr_store_ptr(&fifo->head, entry); return (true); } diff --git a/include/ck_ring.h b/include/ck_ring.h index 14f6380..077d94a 100644 --- a/include/ck_ring.h +++ b/include/ck_ring.h @@ -108,6 +108,7 @@ \ ck_pr_fence_load(); \ *data = ring->ring[consumer]; \ + ck_pr_fence_store(); \ ck_pr_store_uint(&ring->c_head, (consumer + 1) & ring->mask); \ \ return (true); \ @@ -213,6 +214,7 @@ ck_ring_dequeue_spsc(struct ck_ring *ring, void *data) * before this operation completes. */ ck_pr_store_ptr(data, ring->ring[consumer]); + ck_pr_fence_store(); ck_pr_store_uint(&ring->c_head, (consumer + 1) & ring->mask); return (true); }