Skip to content

Commit

Permalink
MpmcArrayQueue-like poll for pooled AtomicChunks on mpmc xadd q
Browse files Browse the repository at this point in the history
  • Loading branch information
franz1981 committed Sep 7, 2019
1 parent 19cbaae commit 7b4246b
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,6 @@ public E poll()
}
continue;
}
e = consumerBuffer.lvElement(consumerOffset);
if (e == null)
{
//another consumer has already consumed the element
continue;
}
}
else
{
Expand Down Expand Up @@ -567,6 +561,10 @@ public E poll()
}
else
{
if (consumerBuffer.isPooled()) {
e = consumerBuffer.lvElement(consumerOffset);
assert e != null;
}
assert !consumerBuffer.isPooled() ||
(consumerBuffer.isPooled() && consumerBuffer.lvSequence(consumerOffset) == chunkIndex);
consumerBuffer.soElement(consumerOffset, null);
Expand Down

0 comments on commit 7b4246b

Please sign in to comment.