On Tue, 5 Jan 2021 09:44:19 GMT, Serguei Spitsyn <[email protected]> wrote:
>> src/hotspot/share/runtime/threadSMR.cpp line 1148:
>>
>>> 1146: }
>>> 1147: }
>>> 1148: if (!EnableThreadSMRStatistics) {
>>
>> You could switch to "if(EnableThreadSMRStatistics)" instead and put this
>> code at the end to avoid repetition. Also I think the comparison with
>> _java_thread_list could be done unconditionally at the end since it's
>> already racy anyways (even if the info was printed with the Threads_lock
>> held it could have changed right after it's released and before returning).
>
> I like the refactoring suggestion from Patricio above to switch to
> "if(EnableThreadSMRStatistics)". The code will be a little more elegant.
Done.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1891