mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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
|
||||
*/
|
||||
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…
Add table
Add a link
Reference in a new issue