8309545: Thread.interrupted from virtual thread needlessly resets interrupt status
Reviewed-by: rpressler, dholmes, jpai
This commit is contained in:
parent
f91e9ba757
commit
97df6cf55a
@ -874,13 +874,14 @@ final class VirtualThread extends BaseVirtualThread {
|
||||
@Override
|
||||
boolean getAndClearInterrupt() {
|
||||
assert Thread.currentThread() == this;
|
||||
synchronized (interruptLock) {
|
||||
boolean oldValue = interrupted;
|
||||
if (oldValue)
|
||||
boolean oldValue = interrupted;
|
||||
if (oldValue) {
|
||||
synchronized (interruptLock) {
|
||||
interrupted = false;
|
||||
carrierThread.clearInterrupt();
|
||||
return oldValue;
|
||||
carrierThread.clearInterrupt();
|
||||
}
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user