Skip to content

Commit

Permalink
Merge pull request #885 from ThanHenderson/sync-dead
Browse files Browse the repository at this point in the history
Remove synchronized block in Thread isDead method
  • Loading branch information
babsingh authored Nov 13, 2024
2 parents 18b53f7 + 354ae2b commit 0b4345f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -3149,10 +3149,8 @@ private Thread(String vmName, Object vmThreadGroup, int vmPriority, boolean vmIs
}

private boolean isDead() {
// Has already started, is not alive anymore, and has been removed from the ThreadGroup
synchronized (interruptLock) {
return (started && (eetop == NO_REF));
}
/* Has already started and is not alive anymore. */
return started && (eetop == NO_REF);
}

Thread(Runnable runnable, String threadName, boolean isSystemThreadGroup, boolean inheritThreadLocals, boolean isDaemon, ClassLoader contextClassLoader) {
Expand Down

0 comments on commit 0b4345f

Please sign in to comment.