RFR: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread [v2]
Coleen Phillimore
coleenp at openjdk.org
Wed Jan 31 16:34:13 UTC 2024
On Wed, 31 Jan 2024 01:21:11 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add regression test
>
> src/hotspot/share/runtime/synchronizer.cpp line 1312:
>
>> 1310: // Can be called from non JavaThreads (e.g., VMThread) for FastHashCode
>> 1311: // calculations as part of JVM/TI tagging.
>> 1312: static bool is_lock_owned(JavaThread* locking_thread, oop obj) {
>
> The parameter does not need renaming here, we are asking if some thread is the owner, it is not trying to lock anything. Also you've invalidated the comment by making this take a JavaThread instead of Thread.
Yes, fix this comment. If the locking_thread is null, then the lock isn't owned by anybody. You can reword the comment to point out that the locking_thread will be null if it's called from non-JavaThreads (eg. VMThread) etc. because the comment is a useful reminder.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17626#discussion_r1473121351
More information about the hotspot-dev
mailing list