Skip to content
Permalink
Browse files
8253179: Replace LinkedList Impl in net.http.Http2Connection
Reviewed-by: dfuchs, prappo, chegar, shade
  • Loading branch information
c-cleary authored and shipilev committed Oct 7, 2020
1 parent 3973073 commit 703b345eeed5765cee281c1aa874a2e674a20585
Showing 1 changed file with 3 additions and 4 deletions.
@@ -33,14 +33,14 @@
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.ArrayList;
import java.util.Objects;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Flow;
@@ -248,7 +248,7 @@ void markPrefaceSent() {
//-------------------------------------
final HttpConnection connection;
private final Http2ClientImpl client2;
private final Map<Integer,Stream<?>> streams = new ConcurrentHashMap<>();
private final ConcurrentMap<Integer,Stream<?>> streams = new ConcurrentHashMap<>();
private int nextstreamid;
private int nextPushStream = 2;
// actual stream ids are not allocated until the Headers frame is ready
@@ -700,8 +700,7 @@ void shutdown(Throwable t) {
Throwable initialCause = this.cause;
if (initialCause == null) this.cause = t;
client2.deleteConnection(this);
List<Stream<?>> c = new LinkedList<>(streams.values());
for (Stream<?> s : c) {
for (Stream<?> s : streams.values()) {
try {
s.connectionClosing(t);
} catch (Throwable e) {

1 comment on commit 703b345

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 703b345 Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.