On throwing InterruptedException
Alan Bateman
alan.bateman at oracle.com
Thu Nov 6 09:37:13 UTC 2025
On 05/11/2025 14:00, Remi Forax wrote:
> :
>
> If a thread is interrupted, it should stop ASAP.
> So if you catch InterruptedException and rethrow a new exception, this should be okay (as Alan said).
Rethrowing the InterruptedException is okay. Throwing a new exception
that is not an InterruptedException is okay too but only after restoring
the interrupted status, otherwise the thread might block again is some
catch block as it unwinds.
-Alan
More information about the core-libs-dev
mailing list