RFR: 8320318: ObjectMonitor Responsible thread [v2]

Fredrik Bredberg fbredberg at openjdk.org
Tue Sep 17 12:06:09 UTC 2024


On Mon, 16 Sep 2024 15:54:52 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update one, after the review
>
> src/hotspot/share/runtime/objectMonitor.hpp line 360:
> 
>> 358: 
>> 359:   enum class TryLockResult { Interference = -1, HasOwner = 0, Success = 1 };
>> 360:   TryLockResult  TryLock(JavaThread* current);
> 
> This CamelCase syntax is used for private methods. We should change it to try_lock now that we are calling it from SharedRuntime code. Another alternative is to keep it private and just use the already available try_enter(). That has the benefit of not having to make TryLockResult public either. If we want to skip the checks after TryLock in try_enter we could add a check_owner_already boolean.

Good suggestion! I'll go with the "Another alternative...".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19454#discussion_r1763120938


More information about the hotspot-dev mailing list