RFR: 8277969: HttpClient SelectorManager shuts down when custom Executor rejects a task [v3]
Daniel Fuchs
dfuchs at openjdk.java.net
Thu Mar 10 11:17:28 UTC 2022
On Thu, 10 Mar 2022 10:44:45 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> The acquire() method will return true the first time it's been called. And it is called only once. So we only need to check whether `acquired` is true at places where we are in doubt about whether the method has been called.
>> The code that calls acquire() above could simply have ignored the result of `acquire()` and set the boolean to `true`. That said, it would not be wrong to check whether `acquired==true` here too - maybe I should do it for consistency...
>
>> The acquire() method will return true the first time it's been called. And it is called only once. So we only need to check whether acquired is true at places where we are in doubt about whether the method has been called.
>
> I see what you mean.
Instead of checking `acquired` in the lambda - which requires `acquired` being final, I will add a line to assert that `assert acquired == true` after calling `acquire()`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7196
More information about the net-dev
mailing list