Skip to content

Commit e4297a7

Browse files
Ben TaylorPaul Hohensee
Ben Taylor
authored and
Paul Hohensee
committedNov 19, 2024
8339882: Replace ThreadLocalStorage::thread with Thread::current_or_null in jdk8 backport of JDK-8183925
Reviewed-by: phh, andrew
1 parent ed3d731 commit e4297a7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎hotspot/src/os/posix/vm/os_posix.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ bool os::ThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
876876

877877
Thread::muxAcquire(&_crash_mux, "CrashProtection");
878878

879-
_protected_thread = ThreadLocalStorage::thread();
879+
_protected_thread = Thread::current_or_null();
880880
assert(_protected_thread != NULL, "Cannot crash protect a NULL thread");
881881

882882
// we cannot rely on sigsetjmp/siglongjmp to save/restore the signal mask

‎hotspot/src/os/windows/vm/os_windows.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4890,7 +4890,7 @@ bool os::ThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
48904890

48914891
Thread::muxAcquire(&_crash_mux, "CrashProtection");
48924892

4893-
_protected_thread = ThreadLocalStorage::thread();
4893+
_protected_thread = Thread::current_or_null();
48944894
assert(_protected_thread != NULL, "Cannot crash protect a NULL thread");
48954895

48964896
bool success = true;

‎hotspot/src/share/vm/runtime/os.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) {
619619

620620
// Since os::malloc can be called when the libjvm.{dll,so} is
621621
// first loaded and we don't have a thread yet we must accept NULL also here.
622-
assert(!os::ThreadCrashProtection::is_crash_protected(ThreadLocalStorage::thread()),
622+
assert(!os::ThreadCrashProtection::is_crash_protected(Thread::current_or_null()),
623623
"malloc() not allowed when crash protection is set");
624624

625625
if (size == 0) {

0 commit comments

Comments
 (0)
Please sign in to comment.