8268855: Cleanup name handling in the Thread class and subclasses

Reviewed-by: lfoltan, coleenp
This commit is contained in:
David Holmes 2021-06-24 23:58:32 +00:00
parent c79034e0c9
commit 08ee7ae672
16 changed files with 71 additions and 51 deletions

View file

@ -975,7 +975,7 @@ void DeadlockCycle::print_on_with(ThreadsList * t_list, outputStream* st) const
waitingToLockRawMonitor = currentThread->current_pending_raw_monitor();
waitingToLockBlocker = currentThread->current_park_blocker();
st->cr();
st->print_cr("\"%s\":", currentThread->get_thread_name());
st->print_cr("\"%s\":", currentThread->name());
const char* owner_desc = ",\n which is held by";
// Note: As the JVM TI "monitor contended enter" event callback is executed after ObjectMonitor
@ -987,7 +987,7 @@ void DeadlockCycle::print_on_with(ThreadsList * t_list, outputStream* st) const
if (owner != NULL) {
if (owner->is_Java_thread()) {
currentThread = JavaThread::cast(owner);
st->print_cr("%s \"%s\"", owner_desc, currentThread->get_thread_name());
st->print_cr("%s \"%s\"", owner_desc, currentThread->name());
} else {
st->print_cr(",\n which has now been released");
}
@ -1026,7 +1026,7 @@ void DeadlockCycle::print_on_with(ThreadsList * t_list, outputStream* st) const
currentThread = java_lang_Thread::thread(ownerObj);
assert(currentThread != NULL, "AbstractOwnableSynchronizer owning thread is unexpectedly NULL");
}
st->print_cr("%s \"%s\"", owner_desc, currentThread->get_thread_name());
st->print_cr("%s \"%s\"", owner_desc, currentThread->name());
}
st->cr();
@ -1038,7 +1038,7 @@ void DeadlockCycle::print_on_with(ThreadsList * t_list, outputStream* st) const
st->print_cr("===================================================");
for (int j = 0; j < len; j++) {
currentThread = _threads->at(j);
st->print_cr("\"%s\":", currentThread->get_thread_name());
st->print_cr("\"%s\":", currentThread->name());
currentThread->print_stack_on(st);
}
JavaMonitorsInStackTrace = oldJavaMonitorsInStackTrace;