RFR: 8332610: Remove unused nWakeups ObjectMonitor [v3]

David Holmes dholmes at openjdk.org
Wed May 22 05:14:05 UTC 2024


On Tue, 21 May 2024 14:48:15 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Hi,
>> 
>> This comment only serves to confuse people, as `nWakeups` is not shared between threads and never read. It is probably meant for debugging (not sure). Let's delete the comment.
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Delete the second nWakeups

Interestingly this code has been dead since it was introduced. I will assume it was leftover debugging/performance-monitoring code.

src/hotspot/share/runtime/objectMonitor.cpp line 1017:

> 1015:     // Note that the counter is not protected by a lock or updated by atomics.
> 1016:     // That is by design - we trade "lossy" counters which are exposed to
> 1017:     // races during updates for a lower probe effect.

The same comment block needs deleting at line 874 too.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19326#pullrequestreview-2070108553
PR Review Comment: https://git.openjdk.org/jdk/pull/19326#discussion_r1609269156


More information about the hotspot-runtime-dev mailing list