From 354ae2bf105efce231f7d9abd43da0f07b04fe97 Mon Sep 17 00:00:00 2001 From: Nathan Henderson Date: Tue, 12 Nov 2024 15:35:21 -0500 Subject: [PATCH] Remove synchronized block in Thread isDead method Related: https://github.com/eclipse-openj9/openj9/pull/20415 Related: https://github.com/eclipse-openj9/openj9/issues/20414 Signed-off-by: Nathan Henderson --- src/java.base/share/classes/java/lang/Thread.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 46f87bdf369..23a9734a168 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -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) {