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 #41 from tajila/origin
Browse files Browse the repository at this point in the history
Remove unnecessary interrupt call
  • Loading branch information
JasonFengJ9 authored Oct 21, 2022
2 parents 5d5a547 + 50e3c90 commit 4ab9a18
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -1750,22 +1750,20 @@ public final void stop() {
* @revised 6.0, 14
*/
public void interrupt() {
if (this != Thread.currentThread()) {
if (currentThread() != this) {
checkAccess();
}

synchronized (interruptLock) {
interrupt0(); // inform VM of interrupt
interrupted = true;

// thread may be blocked in an I/O operation
synchronized (interruptLock) {
Interruptible b = nioBlocker;
if (b != null) {
interrupted = true;
interrupt0(); // inform VM of interrupt
b.interrupt(this);
return;
}
Interruptible b = nioBlocker;
if (b != null) {
b.interrupt(this);
}
}
interrupted = true;
interrupt0(); // inform VM of interrupt
}

/**
Expand Down

0 comments on commit 4ab9a18

Please sign in to comment.