RFR: 8241403: JavaThread::get_thread_name() should be ThreadSMR-aware [v3]

Daniel D.Daugherty dcubed at openjdk.java.net
Wed Feb 17 17:36:48 UTC 2021


On Wed, 17 Feb 2021 07:32:46 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Daniel D. Daugherty has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8241403
>>  - Address coleenp CR0 comments.
>>  - 8241403: JavaThread::get_thread_name() should be ThreadSMR-aware
>
> Hi Dan,
> 
> Sorry but I have a lot of issues with this. After thinking about it a lot I don't think the current approach is what is needed. To repeat what I wrote in one of the comments I think the simple fix here is to replace the use of Threads_lock in the caller with suitable use of a TLH, and then replace the assert_locked_or_safepoint(Threads_lock) with assert(is_JavaThread_protected(t)) where is_JavaThread_protected checks the target for either being the current thread or included in a TLH of the current thread. I don't think get_thread_name() should try to protect the target as that is the responsibility of the caller.
> 
> Thanks,
> David

@dholmes-ora - I'm really glad that I waited for your review! Thanks for taking the time.

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

PR: https://git.openjdk.java.net/jdk/pull/2535


More information about the hotspot-runtime-dev mailing list