On Mon, 11 Jul 2022 04:10:49 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> 8066859 : java/lang/ref/OOMEInReferenceHandler.java failed with 
>> java.lang.Exception: Reference Handler thread died
>
> src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
>  line 296:
> 
>> 294:         byte spins = 0, postSpins = 0;   // retries upon unpark of 
>> first thread
>> 295:         boolean interrupted = false, first = false;
>> 296:         Node pred = null, t;             // predecessor of node when 
>> enqueued
> 
> Nit: please don't use this style of multi-variable declaration as they are 
> very easy to mis-read. Also the comment only applies to one of the variables.

OK, changed.

> src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
>  line 1626:
> 
>> 1624:             }
>> 1625:             if (!isHeldExclusively() || !release(savedState = 
>> getState()))
>> 1626:                 throw LockSupport.staticIllegalMonitorStateException; 
>> // OOM
> 
> How is it possible to get IMSE this deep into the code? And the comment is 
> confusing - OOM?

Clarified to:
            // fall through if encountered OutOfMemoryError
            if (!isHeldExclusively() || !release(savedState = getState()))
                throw LockSupport.staticIllegalMonitorStateException;

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

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

Reply via email to