diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 19c3cda11c6..aa6e1db54ca 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -1774,7 +1774,9 @@ public static boolean interrupted() { public boolean isInterrupted() { // use fully qualified name to avoid ambiguous class error if (com.ibm.oti.vm.VM.isJVMInSingleThreadedMode()) { - return isInterruptedImpl(); + synchronized (interruptLock) { + return isInterruptedImpl(); + } } return interrupted; } @@ -3031,7 +3033,9 @@ private void setPriority0(int newPriority) { } private void interrupt0() { - interruptImpl(); + synchronized (interruptLock) { + interruptImpl(); + } } private static void clearInterruptEvent() {