changeset 13354:a414aa7bc5ba

Merge
author coleenp
date Tue, 18 Jul 2017 19:56:18 +0000
parents 4f74286deaa3 ebab242c2824
children 56a68e37d23b
files
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.hpp	Tue Jul 18 15:46:04 2017 -0400
+++ b/src/share/vm/runtime/thread.hpp	Tue Jul 18 19:56:18 2017 +0000
@@ -674,12 +674,18 @@
 #ifndef USE_LIBRARY_BASED_TLS_ONLY
   return _thr_current;
 #else
-  return ThreadLocalStorage::thread();
+  if (ThreadLocalStorage::is_initialized()) {
+    return ThreadLocalStorage::thread();
+  }
+  return NULL;
 #endif
 }
 
 inline Thread* Thread::current_or_null_safe() {
-  return ThreadLocalStorage::thread();
+  if (ThreadLocalStorage::is_initialized()) {
+    return ThreadLocalStorage::thread();
+  }
+  return NULL;
 }
 
 // Name support for threads.  non-JavaThread subclasses with multiple