diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index ac00e85ba11..8b493d4ef3d 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -876,7 +876,7 @@ bool os::ThreadCrashProtection::call(os::CrashProtectionCallback& cb) { Thread::muxAcquire(&_crash_mux, "CrashProtection"); - _protected_thread = ThreadLocalStorage::thread(); + _protected_thread = Thread::current_or_null(); assert(_protected_thread != NULL, "Cannot crash protect a NULL thread"); // we cannot rely on sigsetjmp/siglongjmp to save/restore the signal mask diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index e7c38f1ea7d..3c6145cfbc0 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -4890,7 +4890,7 @@ bool os::ThreadCrashProtection::call(os::CrashProtectionCallback& cb) { Thread::muxAcquire(&_crash_mux, "CrashProtection"); - _protected_thread = ThreadLocalStorage::thread(); + _protected_thread = Thread::current_or_null(); assert(_protected_thread != NULL, "Cannot crash protect a NULL thread"); bool success = true; diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 96eed036705..9a1f38414bf 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -619,7 +619,7 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { // Since os::malloc can be called when the libjvm.{dll,so} is // first loaded and we don't have a thread yet we must accept NULL also here. - assert(!os::ThreadCrashProtection::is_crash_protected(ThreadLocalStorage::thread()), + assert(!os::ThreadCrashProtection::is_crash_protected(Thread::current_or_null()), "malloc() not allowed when crash protection is set"); if (size == 0) {