On Wed, 11 May 2022 16:38:54 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

>> If you want to avoid processing asynchronous exceptions during this upcall 
>> you could block them (check NoAsyncExceptionDeliveryMark in 
>> JavaThread::exit()). Seems you could set the flag in 
>> ProgrammableUpcallhandler::on_entry() and unset it back on 
>> ProgrammableUpcallhandler::on_exit(). While that flag is set any 
>> asynchronous exception in the handshake queue of this thread will be skipped 
>> from processing. Maybe we should add a public method in the JavaThread 
>> class, block_async_exceptions()/unblock_async_exceptions() so we hide the 
>> handshake implementation.
> Oh nice! I was just thinking that the only possible way out of this conundrum 
> would be to somehow block the delivery of async exceptions (at least outside 
> of the user's exception handler). So, that seems to be exactly what we need :)

I went ahead and implemented this suggestion. Now we block async exceptions in 
on_entry, and unblock in on_exit.


PR: https://git.openjdk.java.net/jdk/pull/7959

Reply via email to