Skip to content

Commit 752c2a7

Browse files
committed
Avoid request(0) to trigger a recursive call.
1 parent 3c46285 commit 752c2a7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/rx/internal/operators/OperatorMerge.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ private boolean drainQueuesIfNeeded() {
307307
} finally {
308308
boolean moreToDrain = releaseEmitLock();
309309
// request outside of lock
310-
request(emitted);
310+
if (emitted > 0) {
311+
request(emitted);
312+
}
311313
if (!moreToDrain) {
312314
return true;
313315
}
@@ -524,6 +526,7 @@ private static final class InnerSubscriber<T> extends Subscriber<T> {
524526
final MergeSubscriber<T> parentSubscriber;
525527
final MergeProducer<T> producer;
526528
/** Make sure the inner termination events are delivered only once. */
529+
@SuppressWarnings("unused")
527530
volatile int terminated;
528531
@SuppressWarnings("rawtypes")
529532
static final AtomicIntegerFieldUpdater<InnerSubscriber> ONCE_TERMINATED = AtomicIntegerFieldUpdater.newUpdater(InnerSubscriber.class, "terminated");

0 commit comments

Comments
 (0)