On Mon, 14 Mar 2022 10:04:13 GMT, Michael McMahon <micha...@openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Copyright years
>
> src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java 
> line 155:
> 
>> 153:     boolean offerConnection(Http2Connection c) {
>> 154:         if (debug.on()) debug.log("offering to the connection pool: 
>> %s", c);
>> 155:         if (!c.isOpen() || c.finalStream()) {
> 
> Is this check for isOpen() not redundant given the same check added inside 
> the synchronized block?

Possibly - but it allows to break out fast without having to enter the 
synchronized block.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7776

Reply via email to