aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorThomas Gschwantner <tharre3@gmail.com>2018-06-10 21:46:31 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-18 15:08:56 +0200
commitb53f925b52f9b92b8a5b1c55e24bdd8c12ddd32b (patch)
tree3ff7f5cec70f88739041c3b6bf6554647383f035
parentmpmc_ptr_ring: Switch to smp_[rw]mb() (diff)
downloadwireguard-monolithic-historical-b53f925b52f9b92b8a5b1c55e24bdd8c12ddd32b.tar.xz
wireguard-monolithic-historical-b53f925b52f9b92b8a5b1c55e24bdd8c12ddd32b.zip
mpmc_ptr_ring: add include guard
-rw-r--r--src/mpmc_ptr_ring.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mpmc_ptr_ring.h b/src/mpmc_ptr_ring.h
index 3a59bf1..f437ae3 100644
--- a/src/mpmc_ptr_ring.h
+++ b/src/mpmc_ptr_ring.h
@@ -1,8 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018 Jonathan Neuschäfer
+ * Copyright (C) 2018 Thomas Gschwantner <tharre3@gmail.com>. All Rights Reserved.
*/
+#ifndef MPMC_RING_PTR_H
+#define MPMC_RING_PTR_H
+
/*
* This is an implementation of a Multi-Producer/Multi-Consumer (MPMC) queue,
* strongly inspired by ConcurrencyKit[1], and Linux's own ptr_ring.h.
@@ -207,3 +211,5 @@ static inline void __mpmc_ptr_ring_discard_one(struct mpmc_ptr_ring *r)
smp_mb__before_atomic();
atomic_inc(&r->consumer_head);
}
+
+#endif /* MPMC_RING_PTR_H */