RFR: 8240588: _threadObj cannot be used on an exiting JavaThread

David Holmes david.holmes at oracle.com
Wed May 13 22:45:53 UTC 2020


Hi Kim,

On 14/05/2020 7:54 am, Kim Barrett wrote:
>> On May 12, 2020, at 9:27 PM, David Holmes <david.holmes at oracle.com> wrote:
>>
>> webrev: http://cr.openjdk.java.net/~dholmes/8240588/webrev.v3/
>> bug: https://bugs.openjdk.java.net/browse/JDK-8240588
> 
> Looks good.

Thanks for looking at this, and thanks for your assistance with the GC 
interactions.

> A couple comments for which I don't need a new webrev if you decide to
> make the suggested changes.
> 
> ------------------------------------------------------------------------------
> src/hotspot/share/runtime/threadSMR.cpp
> 1194   assert(Threads_lock->owned_by_self(), "invariant");
> 1202   assert(Threads_lock->owned_by_self(), "invariant");
> 
> assert_lock_strong(Threads_lock);

I find that a very oddly defined method. I see no point in using an if 
and a fatal given the method is only defined when ASSERT is true! So it 
can just use assert(lock->owned_by_self()). I left my asserts as-is.

> ------------------------------------------------------------------------------
> src/hotspot/share/runtime/threadSMR.cpp
> 1207   for (Holder* current = _exiting_threads, **prev_next = &_exiting_threads;
> 
> This took me a while to parse.  I'd prefer a separate declaration of
> prev_next before the for-loop.
> 
> ------------------------------------------------------------------------------

Noted but left as-is.

Thanks again!

David



More information about the hotspot-runtime-dev mailing list