changeset 51376:7348c41ca46d

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
author plevart
date Sun, 24 Jun 2018 10:41:51 +0200
parents f132a0f1c2dd
children e7519209f7ff
files src/java.base/share/classes/java/lang/Thread.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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) {