Skip to content

Commit

Permalink
Merge pull request #1493 from smallrye/refactor/concatmap-no-cas-on-u…
Browse files Browse the repository at this point in the history
…nbounded

refactor: avoid a compare&swap on unbounded requests
  • Loading branch information
jponge committed Jan 22, 2024
2 parents b8da91f + 4811b4b commit e2bb9d9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public void onItem(I item) {

private void innerOnItem(O item) {
if (state != State.DONE) {
DEMAND_UPDATER.decrementAndGet(this);
if (demand < Long.MAX_VALUE) {
DEMAND_UPDATER.decrementAndGet(this);
}
downstream.onItem(item);
}
}
Expand Down

0 comments on commit e2bb9d9

Please sign in to comment.