mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8309545: Thread.interrupted from virtual thread needlessly resets interrupt status
Backport-of: 97df6cf55a
This commit is contained in:
committed by
Vitaly Provodin
parent
633c0070f0
commit
f5753ba95e
@@ -864,13 +864,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
|
||||
|
||||
Reference in New Issue
Block a user