GeezerVison is showing github.com — Quic: don't mark streamCreditsInitialized volatile · netty/netty@292b9bc
File tree
Expand file treeCollapse file tree
Open diff view settings
codec-classes-quic/src/main/java/io/netty/handler/codec/quic
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -184,11 +184,12 @@ public void operationComplete(ChannelFuture future) { |
184 | 184 | AtomicLongFieldUpdater.newUpdater(QuicheQuicChannel.class, "bidiStreamsLeft"); |
185 | 185 | private volatile long bidiStreamsLeft; |
186 | 186 |
|
187 | | - // Whether the cached stream credits were refreshed from quiche at least once. Before the |
| 187 | + // Whether the cached stream credits were refreshed from quiche at least once. Only updated |
| 188 | + // and accessed from the event loop thread, so it needs no synchronization. Before the |
188 | 189 | // first refresh the caches are 0 even though the peer may have announced credits, so the |
189 | 190 | // fail-fast check in connectStream(...) must not fire yet; a rejected implicit open in |
190 | 191 | // that window is instead handled by rolling back the allocated stream id. |
191 | | - private volatile boolean streamCreditsInitialized; |
| 192 | + private boolean streamCreditsInitialized; |
192 | 193 |
|
193 | 194 | private QuicheQuicChannel(Channel parent, boolean server, @Nullable ByteBuffer key, InetSocketAddress local, |
194 | 195 | InetSocketAddress remote, boolean supportsDatagram, ChannelHandler streamHandler, |
|