RFR: 8231627: ThreadsListHandleInErrorHandlingTest.java fails in printing all threads
Daniel D.Daugherty
dcubed at openjdk.java.net
Tue Jan 5 21:33:55 UTC 2021
On Tue, 5 Jan 2021 09:44:19 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> 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
More information about the serviceability-dev
mailing list