We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcda8a8 commit 669934eCopy full SHA for 669934e
src/main/java/rx/internal/operators/OnSubscribeRedo.java
@@ -236,9 +236,15 @@ public void onError(Throwable e) {
236
public void onNext(T v) {
237
if (!done) {
238
child.onNext(v);
239
- long cap = consumerCapacity.get();
240
- if (cap != Long.MAX_VALUE) {
241
- consumerCapacity.compareAndSet(cap, cap -1);
+ while (true) {
+ long cc = consumerCapacity.get();
+ if (cc != Long.MAX_VALUE) {
242
+ if (consumerCapacity.compareAndSet(cc, cc -1)) {
243
+ break;
244
+ }
245
+ } else {
246
247
248
}
249
250
0 commit comments