Re: RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread Jaikiran Pai
On Wed, 7 Jun 2023 15:12:40 GMT, Alan Bateman wrote: > Thread.interrupted is used to "get and clear" the current thread's interrupt > status. When called from a virtual thread, the current implementation always > clears the carrier's interrupt status. There is no need to do this when the > int

Re: RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread David Holmes
On Wed, 7 Jun 2023 15:12:40 GMT, Alan Bateman wrote: > Thread.interrupted is used to "get and clear" the current thread's interrupt > status. When called from a virtual thread, the current implementation always > clears the carrier's interrupt status. There is no need to do this when the > int

Re: RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread Ron Pressler
On Wed, 7 Jun 2023 15:12:40 GMT, Alan Bateman wrote: > Thread.interrupted is used to "get and clear" the current thread's interrupt > status. When called from a virtual thread, the current implementation always > clears the carrier's interrupt status. There is no need to do this when the > int

Re: RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread David Holmes
On Thu, 8 Jun 2023 10:21:07 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/lang/VirtualThread.java line 879: >> >>> 877: boolean oldValue = interrupted; >>> 878: if (oldValue) { >>> 879: synchronized (interruptLock) { >> >> Don't you still need to read

Re: RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread Alan Bateman
On Thu, 8 Jun 2023 09:38:52 GMT, David Holmes wrote: >> Thread.interrupted is used to "get and clear" the current thread's interrupt >> status. When called from a virtual thread, the current implementation always >> clears the carrier's interrupt status. There is no need to do this when the >>

Re: RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread David Holmes
On Wed, 7 Jun 2023 15:12:40 GMT, Alan Bateman wrote: > Thread.interrupted is used to "get and clear" the current thread's interrupt > status. When called from a virtual thread, the current implementation always > clears the carrier's interrupt status. There is no need to do this when the > int

RFR: 8309545: Thread.interrupted from virtual thread needlessly resets interrupt status

2023-06-08 Thread Alan Bateman
Thread.interrupted is used to "get and clear" the current thread's interrupt status. When called from a virtual thread, the current implementation always clears the carrier's interrupt status. There is no need to do this when the interrupt status is not set, it can just read the interrupt status