The following bug fix changed ThreadsSMRSupport::print_info_on()
to use try_lock():
JDK-8231627 ThreadsListHandleInErrorHandlingTest.java fails in printing all threads
However, it should have skipped the rank check:
$ git diff
diff --git a/src/hotspot/share/runtime/threadSMR.cpp b/src/hotspot/share/runtime/threadSMR.cpp
index 9b70bdf753c..1ed8ac04246 100644
--- a/src/hotspot/share/runtime/threadSMR.cpp
+++ b/src/hotspot/share/runtime/threadSMR.cpp
@@ -1107,7 +1107,7 @@ void ThreadsSMRSupport::print_info_on(const Thread* thread, outputStream* st) {
// Print Threads class SMR info.
void ThreadsSMRSupport::print_info_on(outputStream* st) {
bool needs_unlock = false;
- if (Threads_lock->try_lock()) {
+ if (Threads_lock->try_lock_without_rank_check()) {
// We were able to grab the Threads_lock which makes things safe for
// this call, but if we are error reporting, then a nested error
// could happen with the Threads_lock held.