RFR: 8343394: Make MemorySessionImpl.state a stable field [v2]

Quan Anh Mai qamai at openjdk.org
Thu Oct 31 18:10:02 UTC 2024


On Thu, 31 Oct 2024 17:41:22 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add LoopOverRandom benchmarks
>
> src/java.base/share/classes/jdk/internal/foreign/ConfinedSession.java line 44:
> 
>> 42:     private int asyncReleaseCount = 0;
>> 43: 
>> 44:     static final VarHandle ASYNC_RELEASE_COUNT= MhUtil.findVarHandle(MethodHandles.lookup(), "asyncReleaseCount", int.class);
> 
> Since you are here, maybe you want to use `MHUtil::findVarHandle` also for the state var handle (for uniformity)

I'm a little confused, I use `MHUtil::findVarHandle` for `acquireCount`, there is no need for a `VarHandle` for `state`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21810#discussion_r1824950903


More information about the core-libs-dev mailing list