RFR: 8340796: Use a consistent order when loading cxq and EntryList [v2]

Coleen Phillimore coleenp at openjdk.org
Thu Oct 24 20:39:10 UTC 2024


On Thu, 24 Oct 2024 15:28:37 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:

>> Made sure we use a consistent order when reading ObjectMonitor EntryList and cxq while exiting the monitor.
>> That consistent order is EntryList before cxq. Added a comment in the shared code to explaining why it's okay that waiters slip undetected between reading EntryList and cxq.
>> 
>> Tested ok tier1-3.
>
> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update after review

Even though the order isn't strictly important, having the convention to read one before the other avoids the situation where we wonder whether someone's already looked at this to work out whether it's safe to do.  Note this came up in a code review and rather than wondering again whether this is good at some later date, I like that it's in the same order with the comment that explains that load ordering is unnecessary.

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

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21584#pullrequestreview-2393661680


More information about the hotspot-dev mailing list