On Fri, 29 Oct 2021 22:16:17 GMT, Daniel D. Daugherty <[email protected]>
wrote:
>> While the name is somewhat ungainly - and unnecessarily detailed given
>> `is_JavaThread_protected` has a similar constraint - it should be a static
>> function as given because it must only be called on the current thread, and
>> an instance method would give the false impression that it could be called
>> on any thread.
>>
>> That said it should be possible to write that code block only once and reuse
>> it. And the name as I said is somewhat ungainly. You could even have:
>>
>>
>> static bool is_JavaThread_protected(const JavaThread* p, bool checkTLHOnly =
>> false) {
>
> I'm checking out adding the `checkTLHOnly` param to
> `is_JavaThread_protected()`
> and replacing `is_JavaThread_protected_by_my_ThreadsList()` calls with calls
> to the updated function.
Testing went well so the above change will be in the next change that I push.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4677