< prev index next >

src/java.httpclient/share/classes/java/net/http/HttpConnection.java

Print this page
rev 15335 : Async Queues

@@ -51,11 +51,13 @@
         BLOCKING,
         NON_BLOCKING,
         ASYNC
     }
 
-    protected Mode mode;
+    // mode should be volatile, because of reading of the field is not protected by any synchronization
+    protected volatile Mode mode;
+
 
     // address we are connected to. Could be a server or a proxy
     final InetSocketAddress address;
     final HttpClientImpl client;
     protected volatile ByteBuffer buffer;
< prev index next >