The Great Concurrency Smackdown: ZIO versus JDK by John A. De Goes
Ron Pressler
ron.pressler at oracle.com
Wed Mar 15 14:30:29 UTC 2023
On 15 Mar 2023, at 14:15, Arnaud Masson <arnaud.masson at fr.ibm.com<mailto:arnaud.masson at fr.ibm.com>> wrote:
Yes, that would be nice for finally { } blocks.
A bit like what’s suggested here: https://github.com/google/guava/issues/1409#issuecomment-389469315
try {
doSomeIO(); // can throw InterruptedException
…
} finally {
Uninterruptibles.runUninterruptibly(() ->
closeStuff() // cannot throw InterruptedException
) // auto rethrow (delayed) InterruptedException if needed
}
What about try-with-resource?
thanks
Arnaud
Methods that throw InterruptedException clear the interrupt status precisely to allow calling interruptible methods in cleanup code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230315/8e444f6f/attachment.htm>
More information about the loom-dev
mailing list