RFR: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread [v2]

Coleen Phillimore coleenp at openjdk.org
Wed Jan 31 17:23:04 UTC 2024


On Wed, 31 Jan 2024 16:30:58 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

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

Add: the parameter should be locking_thread because that's what you're asking about.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17626#discussion_r1473182987


More information about the hotspot-dev mailing list