Skip to content

Commit facef7c

Browse files
authored
Merge pull request #30 from qqqlab/patch-1
mpmc/queue: Fix condition to check push and pop counts
2 parents 7fd11ab + 6146de5 commit facef7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lockfree/mpmc/queue_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ template <typename T, size_t size> bool Queue<T, size>::Push(const T &element) {
5454
const size_t pop_count =
5555
_data[index].pop_count.load(std::memory_order_relaxed);
5656

57-
if (push_count > pop_count) {
57+
if (push_count != pop_count) {
5858
return false;
5959
}
6060

0 commit comments

Comments
 (0)