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

Coleen Phillimore coleenp at openjdk.org
Tue Jan 30 16:17:47 UTC 2024


On Tue, 30 Jan 2024 15:23:27 GMT, Coleen Phillimore <coleenp 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 1323:
> 
>> 1321:     locking_thread = JavaThread::cast(current);
>> 1322:   }
>> 1323:   return inflate(locking_thread, current, object, cause);
> 
> This looks strange passing locking_thread as nullptr.  Why not unconditionally make it current?  How can it ever be null?
> 
> edit: I see, it's guarded by is_lock_owned().  And you want "locking_thread" to be a JavaThread* not Thread* (another source of confusion).  This still looks odd.  Maybe locking_thread should be:
> 
> locking_thread = current->is_Java_thread() ? JavaThread::cast(current) : nullptr;
> 
> Then the LM_LEGACY path makes sense also?

hm, LEGACY doesn't use locking_thread.

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

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


More information about the hotspot-dev mailing list