--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ConnectionPool.java Mon Feb 05 11:53:05 2018 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ConnectionPool.java Mon Feb 05 11:59:39 2018 +0000
@@ -122,7 +122,7 @@
return dbgTag;
}
- void start() {
+ synchronized void start() {
assert !stopped : "Already stopped";
}
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PushGroup.java Mon Feb 05 11:53:05 2018 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/PushGroup.java Mon Feb 05 11:59:39 2018 +0000
@@ -106,15 +106,16 @@
pushPromiseHandler.applyPushPromise(initiatingRequest, pushRequest, acceptor::accept);
- if (acceptor.accepted()) {
- if (acceptor.bodyHandler instanceof UntrustedBodyHandler) {
- ((UntrustedBodyHandler)acceptor.bodyHandler).setAccessControlContext(acc);
+ synchronized (this) {
+ if (acceptor.accepted()) {
+ if (acceptor.bodyHandler instanceof UntrustedBodyHandler) {
+ ((UntrustedBodyHandler) acceptor.bodyHandler).setAccessControlContext(acc);
+ }
+ numberOfPushes++;
+ remainingPushes++;
}
- numberOfPushes++;
- remainingPushes++;
+ return acceptor;
}
- return acceptor;
-
}
// This is called when the main body response completes because it means
@@ -126,7 +127,7 @@
noMorePushesCF.complete(null);
}
- CompletableFuture<Void> pushesCF() {
+ synchronized CompletableFuture<Void> pushesCF() {
return noMorePushesCF;
}