Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from fengxue-IS/getstacktrace
Browse files Browse the repository at this point in the history
Fix Thread.getStackTrace synchronization
  • Loading branch information
tajila authored Oct 29, 2022
2 parents 0deb85c + 0b34e5b commit 2eb6c5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -2571,6 +2571,10 @@ StackTraceElement[] asyncGetStackTrace() {
private Object getStackTrace0() {
Throwable t;
synchronized (interruptLock) {
/* Ensure only live thread is passed to native code. */
if (!isAlive()) {
return EMPTY_STACK_TRACE;
}
t = getStackTraceImpl();
}
return (Object)J9VMInternals.getStackTrace(t, false);
Expand Down

0 comments on commit 2eb6c5c

Please sign in to comment.