aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-05-29 02:36:18 +0200
committerThomas Gschwantner <tharre3@gmail.com>2018-06-22 14:52:22 +0200
commitc37e79b4f2aff00c6f7f3055f6cfc75616b72d9e (patch)
treeb6cac57b0def51caa76ae5d9ca70c539c168dda7
parent[WIP] Implement a lock-free MPMC ring buffer (diff)
downloadwireguard-monolithic-historical-c37e79b4f2aff00c6f7f3055f6cfc75616b72d9e.tar.xz
wireguard-monolithic-historical-c37e79b4f2aff00c6f7f3055f6cfc75616b72d9e.zip
mpmc_ptr_ring: Fix the remaining crash
-rw-r--r--src/mpmc_ptr_ring.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mpmc_ptr_ring.h b/src/mpmc_ptr_ring.h
index 7145a4e..be7c2ff 100644
--- a/src/mpmc_ptr_ring.h
+++ b/src/mpmc_ptr_ring.h
@@ -115,10 +115,10 @@ static inline void *mpmc_ptr_ring_consume(struct mpmc_ptr_ring *r)
for (;;) {
mb(); // TODO: check
- p = atomic_long_read(&r->producer_tail);
- mb(); // TODO: check
c = atomic_long_read(&r->consumer_head);
mb(); // TODO: check
+ p = atomic_long_read(&r->producer_tail);
+ mb(); // TODO: check
/* Is the ring empty? */
if (p == c)