On Sun, 6 Nov 2022 21:57:36 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> If we don't return we'll actually do a wait and will hang.  Worse, we'll be 
>> in a tight loop holding both the ClassLoader and SystemDictionary_lock, that 
>> the other thread can't get.
>
> Okay but isn't that what should be expected? This is a flag to prevent a 
> certain kind of classloader from deadlocking, so if we have that kind of 
> classloader and the flag is disabled, then we should expect deadlock. 
> Otherwise what will the failure mode be here? If we are introducing a new 
> failure mode then it needs to be documented in the CSR request and possibly a 
> Release Note.

Coleen has reminded me that I am confused about what the workaround was doing - 
this code doesn't prevent deadlock, it prevents a LinkageError that would 
otherwise occur because the classloader has done something tricky (released the 
monitor) to prevent deadlock. So the correct behaviour here is proceed with the 
class loading and trigger the LinkageError in the other thread.

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

PR: https://git.openjdk.org/jdk/pull/10832

Reply via email to