Skip to content

Commit 0c2ce61

Browse files
author
Aaron Tull
committed
Merge pull request #3382 from akarnokd/SpscLinkedArrayQueueCapacityUse2x
2.x: fix SpscLinkedArrayQueue leaves 1 slot null just before growing
2 parents 9bc355f + 53e15f1 commit 0c2ce61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/io/reactivex/internal/queue/SpscLinkedArrayQueue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public final boolean offer(final T e) {
7979
if (null == lvElement(buffer, lookAheadElementOffset)) {// LoadLoad
8080
producerLookAhead = index + lookAheadStep - 1; // joy, there's plenty of room
8181
return writeToQueue(buffer, e, index, offset);
82-
} else if (null != lvElement(buffer, calcWrappedOffset(index + 1, mask))) { // buffer is not full
82+
} else if (null == lvElement(buffer, calcWrappedOffset(index + 1, mask))) { // buffer is not full
8383
return writeToQueue(buffer, e, index, offset);
8484
} else {
8585
resize(buffer, index, offset, e, mask); // add a buffer and link old to new

0 commit comments

Comments
 (0)