src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java
changeset 59311 b42eaca7d234
parent 49765 ee6f7a61f3a5
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java	Thu Nov 28 16:38:25 2019 +0100
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java	Thu Nov 28 13:02:30 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -210,7 +210,7 @@
         if (timer1Enabled) {
             timer1.cancel();
         }
-        if (dispatcherThread != null) {
+        if (dispatcherThread != null && dispatcherThread != Thread.currentThread()) {
             try {
                 dispatcherThread.join();
             } catch (InterruptedException e) {