8184339: Thread::current_or_null() shall not assert if Posix TLS is not yet initialized
Reviewed-by: dcubed, coleenp
This commit is contained in:
parent
62da378f03
commit
aaf9f2515f
@ -674,12 +674,18 @@ inline Thread* Thread::current_or_null() {
|
||||
#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
|
||||
|
Loading…
x
Reference in New Issue
Block a user