RFR: 8330051: Small ObjectMonitor spinning code cleanups [v2]

Coleen Phillimore coleenp at openjdk.org
Wed Apr 17 12:32:50 UTC 2024


On Tue, 16 Apr 2024 21:18:29 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> src/hotspot/share/runtime/objectMonitor.hpp line 358:
>> 
>>> 356: 
>>> 357: 
>>> 358:   enum TryLockResult { CAS_FAILED = -1, HAS_OWNER = 0, SUCCESS = 1};
>> 
>> nit: Perhaps just one blank line to separate the new enum.
>
> Using a common prefix on enum values can make things easier to grep for
> and find what you want:
> 
> enum TryLockResult { TL_CAS_FAILED = -1, TL_HAS_OWNER = 0, TL_SUCCESS = 1};
> 
> 
> In particular, `SUCCESS` gets just way too many hits...

Yes, TL_ prefix makes it grep friendly.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18730#discussion_r1568759863


More information about the hotspot-runtime-dev mailing list