RFR: 8343840: Rewrite the ObjectMonitor lists [v2]
Fredrik Bredberg
fbredberg at openjdk.org
Thu Feb 27 20:04:02 UTC 2025
On Wed, 26 Feb 2025 06:08:14 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update after review by David and Coleen.
>
> src/hotspot/share/runtime/objectMonitor.cpp line 232:
>
>> 230: // thread notices that the tail of the entry_list is not known, we
>> 231: // convert the singly-linked entry_list into a doubly linked list by
>> 232: // assigning the prev pointers and the entry_list_tail pointer.
>
> Didn't we essentially say all this at the beginning?
This text makes more sense before the newly added "Example:", so I moved it.
> src/hotspot/share/runtime/objectMonitor.cpp line 260:
>
>> 258: //
>> 259: // * notify() or notifyAll() simply transfers threads from the WaitSet
>> 260: // to either the entry_list. Subsequent exit() operations will
>
> Suggestion:
>
> // to the entry_list. Subsequent exit() operations will
Fixed
> src/hotspot/share/runtime/objectMonitor.cpp line 704:
>
>> 702:
>> 703: for (;;) {
>> 704: ObjectWaiter* front = Atomic::load(&_entry_list);
>
> In comments and code pick "head" or "front" to use to describe what _entry_list points to and use that consistently. I think "front" is much more common.
A `grep -r `suggests that `head` is more common, so I changed to `head`.
> src/hotspot/share/runtime/objectMonitor.cpp line 705:
>
>> 703: for (;;) {
>> 704: ObjectWaiter* front = Atomic::load(&_entry_list);
>> 705:
>
> No need for blank line.
Fixed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23421#discussion_r1974257620
PR Review Comment: https://git.openjdk.org/jdk/pull/23421#discussion_r1974259984
PR Review Comment: https://git.openjdk.org/jdk/pull/23421#discussion_r1974261995
PR Review Comment: https://git.openjdk.org/jdk/pull/23421#discussion_r1974260402
More information about the hotspot-dev
mailing list