Skip to content

Commit 65c4956

Browse files
Kiskaeakarnokd
authored andcommitted
Fix check that would always be false (#6045)
Checking `BlockingSubscriber.TERMINATED` (`new Object()`) against `o` would always be false since `o` is a publisher. Since `v` comes from the queue this is presumably the variable that should be checked. However the check might even be redundant with this change since that variable can only appear in the queue after the subscriber has been cancelled. I am not familiar enough with the memory model to say whether the object appearing in the queue implies the cancelled subscriber is visible.
1 parent fc0ca6e commit 65c4956

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/io/reactivex/internal/operators/flowable/FlowableBlockingSubscribe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static <T> void subscribe(Publisher<? extends T> o, Subscriber<? super T>
6363
if (bs.isCancelled()) {
6464
break;
6565
}
66-
if (o == BlockingSubscriber.TERMINATED
66+
if (v == BlockingSubscriber.TERMINATED
6767
|| NotificationLite.acceptFull(v, subscriber)) {
6868
break;
6969
}

0 commit comments

Comments
 (0)