mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8309545: Thread.interrupted from virtual thread needlessly resets interrupt status
Reviewed-by: rpressler, dholmes, jpai
This commit is contained in:
parent
f91e9ba757
commit
97df6cf55a
1 changed files with 6 additions and 5 deletions
|
@ -874,14 +874,15 @@ final class VirtualThread extends BaseVirtualThread {
|
|||
@Override
|
||||
boolean getAndClearInterrupt() {
|
||||
assert Thread.currentThread() == this;
|
||||
synchronized (interruptLock) {
|
||||
boolean oldValue = interrupted;
|
||||
if (oldValue)
|
||||
if (oldValue) {
|
||||
synchronized (interruptLock) {
|
||||
interrupted = false;
|
||||
carrierThread.clearInterrupt();
|
||||
return oldValue;
|
||||
}
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
Thread.State threadState() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue