Merge
authorcoleenp
Tue, 18 Jul 2017 19:56:18 +0000
changeset 46690 a97413340818
parent 46689 59f0972cf342 (current diff)
parent 46688 d33b4d593f9b (diff)
child 46691 cecf240c87a0
Merge
--- a/hotspot/src/share/vm/runtime/thread.hpp	Tue Jul 18 15:46:04 2017 -0400
+++ b/hotspot/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