diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-13 15:06:23 +0100 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-13 15:06:23 +0100 |
commit | d1dedcb21e7ba074a0a83fad09a742e54a8d1525 (patch) | |
tree | 31aebff80bf016d32480a1e38b3e58110f8adb67 /libtransport/src/hicn/transport/utils/ring_buffer.h | |
parent | 13fccc2bb1c2317061e6bf985c87bca647fb3b6f (diff) |
[HICN-60] Solved concurrent memory access which was leading to seg-fault
Change-Id: I7b9fcf79bb97650346f7d92af8cbb419f0a5cb95
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/utils/ring_buffer.h')
-rw-r--r-- | libtransport/src/hicn/transport/utils/ring_buffer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libtransport/src/hicn/transport/utils/ring_buffer.h b/libtransport/src/hicn/transport/utils/ring_buffer.h index 52bcd81c4..9babe56bd 100644 --- a/libtransport/src/hicn/transport/utils/ring_buffer.h +++ b/libtransport/src/hicn/transport/utils/ring_buffer.h @@ -86,7 +86,7 @@ bool CircularFifo<Element, Size>::push(Element&& item) { // the tail must be accessed with at least acquire template <typename Element, std::size_t Size> bool CircularFifo<Element, Size>::pop(Element& item) { - const auto current_head = head_.load(std::memory_order_relaxed); + const size_t current_head = head_.load(std::memory_order_relaxed); if (current_head == tail_.load(std::memory_order_acquire)) { return false; // empty queue } |