mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-12 08:53:12 +00:00
8198841: Thread.interrupt should set interrupt status while holding blockerLock
Reviewed-by: bpb
This commit is contained in:
parent
60ce64e54a
commit
95b1eef0da
@ -1007,22 +1007,22 @@ class Thread implements Runnable {
|
||||
* @spec JSR-51
|
||||
*/
|
||||
public void interrupt() {
|
||||
Thread me = Thread.currentThread();
|
||||
if (this != me)
|
||||
if (this != Thread.currentThread()) {
|
||||
checkAccess();
|
||||
|
||||
// set interrupt status
|
||||
interrupt0();
|
||||
|
||||
// thread may be blocked in an I/O operation
|
||||
if (this != me && blocker != null) {
|
||||
// thread may be blocked in an I/O operation
|
||||
synchronized (blockerLock) {
|
||||
Interruptible b = blocker;
|
||||
if (b != null) {
|
||||
interrupt0(); // set interrupt status
|
||||
b.interrupt(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set interrupt status
|
||||
interrupt0();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user