8289385: Cleanup redundant synchronization in Http2ClientImpl

Reviewed-by: jpai, dfuchs
This commit is contained in:
Andrey Turbanov 2022-07-02 15:24:23 +00:00
parent cdf6979259
commit dee5121bd4

View File

@ -31,7 +31,6 @@ import java.io.UncheckedIOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.util.Base64;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@ -57,7 +56,9 @@ class Http2ClientImpl {
Utils.getDebugLogger("Http2ClientImpl"::toString, Utils.DEBUG);
private final HttpClientImpl client;
private volatile boolean stopping;
// only accessed from within synchronized blocks
private boolean stopping;
Http2ClientImpl(HttpClientImpl client) {
this.client = client;
@ -66,7 +67,8 @@ class Http2ClientImpl {
/* Map key is "scheme:host:port" */
private final Map<String,Http2Connection> connections = new ConcurrentHashMap<>();
private final Set<String> failures = Collections.synchronizedSet(new HashSet<>());
// only accessed from within synchronized blocks
private final Set<String> failures = new HashSet<>();
/**
* When HTTP/2 requested only. The following describes the aggregate behavior including the