On Mon, 30 Sep 2024 14:06:35 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> The status might not be explicitly checked, but setting the interrupted 
>> status will make sure that subsequent calls to sleep/await/tryLock etc. will 
>> not block.
>> 
>> In general, we want to preserve the interrupted status until either the user 
>> decides that it's fine to clear, or until the thread dies.
>
> In which case the code might be simplified to just:
> 
>             } catch (InterruptedException e) {
>                 // Don't lose the interrupt
>                 Thread.currentThread().interrupt();
>                 break;
>             }

I've reworked the change to always set the interrupted status. I wouldn't 
remove the check of the error code here, as it'd be a behavior change. I can 
follow up with that, though it seems to me that it's good to still have the 
check for access error here.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20938#discussion_r1781250726

Reply via email to