RFR: 8336384: AbstractQueuedSynchronizer.acquire should cancel acquire when failing due to a LinkageError or other errors

Doug Lea dl at openjdk.org
Mon Aug 12 15:31:31 UTC 2024


On Mon, 12 Aug 2024 14:02:52 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> 8336384: AbstractQueuedSynchronizer.acquire should cancel acquire when failing due to a LinkageError or other errors
>
> src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java line 381:
> 
>> 379:                     else
>> 380:                         break;
>> 381:                 } catch (Error ex) {            // rethrow VM errors
> 
> Part of me things this should be Throwable to allow for possible runtime exceptions when timed-parking virtual threads. There is a separate work needed to ensure a runtime exception is never throw but it would at least cancel here.

Or use (Error | RuntimeException ex)?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20548#discussion_r1713993675


More information about the core-libs-dev mailing list