From 337c3d54629f9ba74cdeedee04fa4b5fc817b5a2 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Tue, 9 Jun 2020 14:14:12 +0200 Subject: [PATCH] Modulo on atomic is not really supported --- sf-stream/src/FastQueue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sf-stream/src/FastQueue.cpp b/sf-stream/src/FastQueue.cpp index 1a67664..e8f5987 100644 --- a/sf-stream/src/FastQueue.cpp +++ b/sf-stream/src/FastQueue.cpp @@ -72,7 +72,7 @@ void FastQueue::commit() } write_slot_id_++; - write_slot_id_ %= n_slots_; + write_slot_id_ = write_slot_id_ % n_slots_; } template @@ -99,7 +99,7 @@ void FastQueue::release() } read_slot_id_++; - read_slot_id_ %= n_slots_; + read_slot_id_ = read_slot_id_ % n_slots_; } template class FastQueue;