aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-05-29 02:36:18 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-04 20:29:48 +0200
commitc7c37f3fc739428befba0df00f2b05c8d7c751c9 (patch)
tree9e1b988e900623aad4f76fa16374699d814efaf2
parent[WIP] Implement a lock-free MPMC ring buffer (diff)
downloadwireguard-monolithic-historical-c7c37f3fc739428befba0df00f2b05c8d7c751c9.tar.xz
wireguard-monolithic-historical-c7c37f3fc739428befba0df00f2b05c8d7c751c9.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)