Skip to content

Commit

Permalink
Acquire interruptLock for
Browse files Browse the repository at this point in the history
Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
  • Loading branch information
babsingh committed Jun 11, 2024
1 parent 92d8c0a commit 672818f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,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;
}
Expand Down Expand Up @@ -3013,7 +3015,9 @@ private void setPriority0(int newPriority) {
}

private void interrupt0() {
interruptImpl();
synchronized (interruptLock) {
interruptImpl();
}
}

private static void clearInterruptEvent() {
Expand Down

0 comments on commit 672818f

Please sign in to comment.