Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8339882: Replace ThreadLocalStorage::thread with Thread::current_or_null in jdk8 backport of JDK-8183925 #576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hotspot/src/os/posix/vm/os_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/os/windows/vm/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/share/vm/runtime/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down