mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8198841: Thread.interrupt should set interrupt status while holding blockerLock
Reviewed-by: bpb
This commit is contained in:
parent
60ce64e54a
commit
95b1eef0da
1 changed files with 7 additions and 7 deletions
|
@ -1007,22 +1007,22 @@ class Thread implements Runnable {
|
||||||
* @spec JSR-51
|
* @spec JSR-51
|
||||||
*/
|
*/
|
||||||
public void interrupt() {
|
public void interrupt() {
|
||||||
Thread me = Thread.currentThread();
|
if (this != Thread.currentThread()) {
|
||||||
if (this != me)
|
|
||||||
checkAccess();
|
checkAccess();
|
||||||
|
|
||||||
// set interrupt status
|
|
||||||
interrupt0();
|
|
||||||
|
|
||||||
// thread may be blocked in an I/O operation
|
// thread may be blocked in an I/O operation
|
||||||
if (this != me && blocker != null) {
|
|
||||||
synchronized (blockerLock) {
|
synchronized (blockerLock) {
|
||||||
Interruptible b = blocker;
|
Interruptible b = blocker;
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
|
interrupt0(); // set interrupt status
|
||||||
b.interrupt(this);
|
b.interrupt(this);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set interrupt status
|
||||||
|
interrupt0();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue