summaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/main')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
index f7f2fc15..6825f07c 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
@@ -115,7 +115,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
/**
* Jetty thread.
*/
- protected volatile Thread jettyThread;
+ protected Thread jettyThread;
/**
* Start condition.
@@ -418,12 +418,13 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
this.stop();
- if (this.jettyThread == null) {
- return;
+ Thread jettyThreadCopy;
+ synchronized (this) {
+ if ((jettyThreadCopy = this.jettyThread) == null) {
+ return;
+ }
}
- Thread jettyThreadCopy = this.jettyThread;
-
if (jettyThreadCopy.isAlive()) {
try {
jettyThreadCopy.join(2000L);