On Fri, 25 Nov 2022 06:26:25 GMT, Jaikiran Pai <[email protected]> wrote:
> This PR also has changes in the `Stream` class. Some of those changes are > typo related fixes, so that's fine. However, it also has other functional > changes. Is that intentional and related? These are changes I made when investigating the fix, and they are not related. The `pendingResponseSubscriber` is a temporary field that holds the subscriber value until the `responseSubscriber` is handled and subscribed by the `schedule` loop. It is a bit confusing to see a non null `pendingResponseSubscriber` after it has been handled by that loop. Practically, setting it to `null` or leaving it assigned at this point should have no effect on the behavior of this class... Hmmm... except I see ternary operators that first look at the subscriber and then at the pending subscriber. So this change now introduce a potential race condition if they are executed concurrently with the `schedule` loop. Good observation. I will revert that. ------------- PR: https://git.openjdk.org/jdk/pull/11332
