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

Coleen Phillimore coleenp at openjdk.org
Wed Apr 17 14:03:03 UTC 2024


On Wed, 17 Apr 2024 12:26:26 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> 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.

I took an offline suggestion from Stefan and made it a C++ enum class which is better.

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

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


More information about the hotspot-runtime-dev mailing list