On Thu, 4 Nov 2021 01:16:03 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> I suspect that the way that git is displaying the diffs is confusing you.
>> 
>> We need `current_thread` set if we get to line 474 so we have to init
>> `current_thread` on line 446 for the `checkTLHOnly == true` case and
>> on line 463 for the `checkTLHOnly == false` case.
>> 
>> I could simplify the logic by always setting current thread when it is
>> declared on 444, but I was trying to avoid the call to `Thread::current()`
>> until I actually needed it. I thought `Thread::current()` can be expensive.
>> Is this no longer the case?
>
> Sorry I missed that line 463 is still within the else from line 447.
> 
> Thread::current() is a compiler-defined thread-local access so should be 
> relatively cheap these days, but I have no numbers.

I'm really tempted to go ahead and change it to always set
current thread when it is declared and then clean things up a bit.

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

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

Reply via email to