8205540: test/hotspot/jtreg/vmTestbase/nsk/jdb/trace/trace001/trace001.java fails with Debuggee did not exit after 15 <cont> commands
authorplevart
Sun, 24 Jun 2018 10:41:51 +0200
changeset 50742 7348c41ca46d
parent 50741 f132a0f1c2dd
child 50743 e7519209f7ff
8205540: test/hotspot/jtreg/vmTestbase/nsk/jdb/trace/trace001/trace001.java fails with Debuggee did not exit after 15 <cont> commands Summary: screen usage/initialization of TerminatingThreadLocal with a non-null check on Thread.threadLocals field Reviewed-by: dholmes, alanb
src/java.base/share/classes/java/lang/Thread.java
--- a/src/java.base/share/classes/java/lang/Thread.java	Sat Jun 23 22:49:48 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Thread.java	Sun Jun 24 10:41:51 2018 +0200
@@ -840,7 +840,7 @@
      * a chance to clean up before it actually exits.
      */
     private void exit() {
-        if (TerminatingThreadLocal.REGISTRY.isPresent()) {
+        if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) {
             TerminatingThreadLocal.threadTerminated();
         }
         if (group != null) {